Show / Hide Table of Contents

Class CfnDistribution

A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.

Inheritance
object
CfnElement
CfnRefElement
CfnResource
CfnDistribution
Implements
IInspectable
ITaggable
Inherited Members
CfnResource.IsCfnResource(object)
CfnResource.AddDeletionOverride(string)
CfnResource.AddDependency(CfnResource)
CfnResource.AddDependsOn(CfnResource)
CfnResource.AddMetadata(string, object)
CfnResource.AddOverride(string, object)
CfnResource.AddPropertyDeletionOverride(string)
CfnResource.AddPropertyOverride(string, object)
CfnResource.ApplyRemovalPolicy(RemovalPolicy?, IRemovalPolicyOptions)
CfnResource.GetAtt(string, ResolutionTypeHint?)
CfnResource.GetMetadata(string)
CfnResource.ObtainDependencies()
CfnResource.ObtainResourceDependencies()
CfnResource.RemoveDependency(CfnResource)
CfnResource.ReplaceDependency(CfnResource, CfnResource)
CfnResource.ShouldSynthesize()
CfnResource.ToString()
CfnResource.ValidateProperties(object)
CfnResource.CfnOptions
CfnResource.CfnResourceType
CfnResource.UpdatedProperites
CfnResource.UpdatedProperties
CfnRefElement.Ref
CfnElement.IsCfnElement(object)
CfnElement.OverrideLogicalId(string)
CfnElement.CreationStack
CfnElement.LogicalId
CfnElement.Stack
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnDistribution : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnDistribution Inherits CfnResource Implements IInspectable, ITaggable
Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html

CloudformationResource: AWS::CloudFront::Distribution

ExampleMetadata: infused

Examples
// Create the simple Origin
             var myBucket = new Bucket(this, "myBucket");
             var s3Origin = S3BucketOrigin.WithOriginAccessControl(myBucket, new S3BucketOriginWithOACProps {
                 OriginAccessLevels = new [] { AccessLevel.READ, AccessLevel.LIST }
             });

             // Create the Distribution construct
             var myMultiTenantDistribution = new Distribution(this, "distribution", new DistributionProps {
                 DefaultBehavior = new BehaviorOptions {
                     Origin = s3Origin
                 },
                 DefaultRootObject = "index.html"
             });

             // Access the underlying L1 CfnDistribution to configure SaaS Manager properties which are not yet available in the L2 Distribution construct
             var cfnDistribution = (CfnDistribution)myMultiTenantDistribution.Node.DefaultChild;

             var defaultCacheBehavior = new DefaultCacheBehaviorProperty {
                 TargetOriginId = myBucket.BucketArn,
                 ViewerProtocolPolicy = "allow-all",
                 Compress = false,
                 AllowedMethods = new [] { "GET", "HEAD" },
                 CachePolicyId = CachePolicy.CACHING_OPTIMIZED.CachePolicyId
             };
             // Create the updated distributionConfig
             var distributionConfig = new DistributionConfigProperty {
                 DefaultCacheBehavior = defaultCacheBehavior,
                 Enabled = true,
                 // the properties below are optional
                 ConnectionMode = "tenant-only",
                 Origins = new [] { new OriginProperty {
                     Id = myBucket.BucketArn,
                     DomainName = myBucket.BucketDomainName,
                     S3OriginConfig = new S3OriginConfigProperty { },
                     OriginPath = "/{{tenantName}}"
                 } },
                 TenantConfig = new TenantConfigProperty {
                     ParameterDefinitions = new [] { new ParameterDefinitionProperty {
                         Definition = new DefinitionProperty {
                             StringSchema = new StringSchemaProperty {
                                 Required = false,
                                 // the properties below are optional
                                 Comment = "tenantName",
                                 DefaultValue = "root"
                             }
                         },
                         Name = "tenantName"
                     } }
                 }
             };

             // Override the distribution configuration to enable multi-tenancy.
             cfnDistribution.DistributionConfig = distributionConfig;

             // Create a distribution tenant using an existing ACM certificate
             var cfnDistributionTenant = new CfnDistributionTenant(this, "distribution-tenant", new CfnDistributionTenantProps {
                 DistributionId = myMultiTenantDistribution.DistributionId,
                 Domains = new [] { "my-tenant.my.domain.com" },
                 Name = "my-tenant",
                 Enabled = true,
                 Parameters = new [] { new ParameterProperty {
                     Name = "tenantName",
                     Value = "app"
                 } },
                 Customizations = new CustomizationsProperty {
                     Certificate = new CertificateProperty {
                         Arn = "REPLACE_WITH_ARN"
                     }
                 }
             });

Synopsis

Constructors

CfnDistribution(Construct, string, ICfnDistributionProps)

A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.

Properties

AttrDomainName

The domain name of the resource, such as d111111abcdef8.cloudfront.net .

AttrId

The distribution's identifier.

CFN_RESOURCE_TYPE_NAME

The CloudFormation resource type name for this resource class.

CfnProperties

A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.

DistributionConfig

The distribution's configuration.

Tags

Tag Manager which manages the tags for this resource.

TagsRaw

A complex type that contains zero or more Tag elements.

Methods

Inspect(TreeInspector)

Examines the CloudFormation resource and discloses attributes.

RenderProperties(IDictionary<string, object>)

A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.

Constructors

CfnDistribution(Construct, string, ICfnDistributionProps)

A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.

public CfnDistribution(Construct scope, string id, ICfnDistributionProps props)
Parameters
scope Construct

Scope in which this resource is defined.

id string

Construct identifier for this resource (unique in its scope).

props ICfnDistributionProps

Resource properties.

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html

CloudformationResource: AWS::CloudFront::Distribution

ExampleMetadata: infused

Properties

AttrDomainName

The domain name of the resource, such as d111111abcdef8.cloudfront.net .

public virtual string AttrDomainName { get; }
Property Value

string

Remarks

CloudformationAttribute: DomainName

AttrId

The distribution's identifier.

public virtual string AttrId { get; }
Property Value

string

Remarks

For example: E1U5RQF7T870K0 .

CloudformationAttribute: Id

CFN_RESOURCE_TYPE_NAME

The CloudFormation resource type name for this resource class.

public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value

string

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html

CloudformationResource: AWS::CloudFront::Distribution

ExampleMetadata: infused

CfnProperties

A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.

protected override IDictionary<string, object> CfnProperties { get; }
Property Value

IDictionary<string, object>

Overrides
CfnResource.CfnProperties
Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html

CloudformationResource: AWS::CloudFront::Distribution

ExampleMetadata: infused

DistributionConfig

The distribution's configuration.

public virtual object DistributionConfig { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html

CloudformationResource: AWS::CloudFront::Distribution

ExampleMetadata: infused

Tags

Tag Manager which manages the tags for this resource.

public virtual TagManager Tags { get; }
Property Value

TagManager

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html

CloudformationResource: AWS::CloudFront::Distribution

ExampleMetadata: infused

TagsRaw

A complex type that contains zero or more Tag elements.

public virtual ICfnTag[]? TagsRaw { get; set; }
Property Value

ICfnTag[]

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html

CloudformationResource: AWS::CloudFront::Distribution

ExampleMetadata: infused

Methods

Inspect(TreeInspector)

Examines the CloudFormation resource and discloses attributes.

public virtual void Inspect(TreeInspector inspector)
Parameters
inspector TreeInspector

tree inspector to collect and process attributes.

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html

CloudformationResource: AWS::CloudFront::Distribution

ExampleMetadata: infused

RenderProperties(IDictionary<string, object>)

A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.

protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
props IDictionary<string, object>
Returns

IDictionary<string, object>

Overrides
CfnResource.RenderProperties(IDictionary<string, object>)
Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html

CloudformationResource: AWS::CloudFront::Distribution

ExampleMetadata: infused

Implements

IInspectable
ITaggable
Back to top Generated by DocFX