Table of Contents

Interface ICfnDistributionProps

Namespace
Amazon.CDK.AWS.CloudFront
Assembly
Amazon.CDK.AWS.CloudFront.dll

Properties for defining a CfnDistribution.

public interface ICfnDistributionProps

Examples

// The code below shows an example of how to instantiate this type.
             // The values are placeholders you should change.
             using Amazon.CDK.AWS.CloudFront;

             var cfnDistributionProps = new CfnDistributionProps {
                 DistributionConfig = new DistributionConfigProperty {
                     DefaultCacheBehavior = new DefaultCacheBehaviorProperty {
                         TargetOriginId = "targetOriginId",
                         ViewerProtocolPolicy = "viewerProtocolPolicy",

                         // the properties below are optional
                         AllowedMethods = new [] { "allowedMethods" },
                         CachedMethods = new [] { "cachedMethods" },
                         CachePolicyId = "cachePolicyId",
                         Compress = false,
                         DefaultTtl = 123,
                         FieldLevelEncryptionId = "fieldLevelEncryptionId",
                         ForwardedValues = new ForwardedValuesProperty {
                             QueryString = false,

                             // the properties below are optional
                             Cookies = new CookiesProperty {
                                 Forward = "forward",

                                 // the properties below are optional
                                 WhitelistedNames = new [] { "whitelistedNames" }
                             },
                             Headers = new [] { "headers" },
                             QueryStringCacheKeys = new [] { "queryStringCacheKeys" }
                         },
                         FunctionAssociations = new [] { new FunctionAssociationProperty {
                             EventType = "eventType",
                             FunctionArn = "functionArn"
                         } },
                         LambdaFunctionAssociations = new [] { new LambdaFunctionAssociationProperty {
                             EventType = "eventType",
                             IncludeBody = false,
                             LambdaFunctionArn = "lambdaFunctionArn"
                         } },
                         MaxTtl = 123,
                         MinTtl = 123,
                         OriginRequestPolicyId = "originRequestPolicyId",
                         RealtimeLogConfigArn = "realtimeLogConfigArn",
                         ResponseHeadersPolicyId = "responseHeadersPolicyId",
                         SmoothStreaming = false,
                         TrustedKeyGroups = new [] { "trustedKeyGroups" },
                         TrustedSigners = new [] { "trustedSigners" }
                     },
                     Enabled = false,

                     // the properties below are optional
                     Aliases = new [] { "aliases" },
                     CacheBehaviors = new [] { new CacheBehaviorProperty {
                         PathPattern = "pathPattern",
                         TargetOriginId = "targetOriginId",
                         ViewerProtocolPolicy = "viewerProtocolPolicy",

                         // the properties below are optional
                         AllowedMethods = new [] { "allowedMethods" },
                         CachedMethods = new [] { "cachedMethods" },
                         CachePolicyId = "cachePolicyId",
                         Compress = false,
                         DefaultTtl = 123,
                         FieldLevelEncryptionId = "fieldLevelEncryptionId",
                         ForwardedValues = new ForwardedValuesProperty {
                             QueryString = false,

                             // the properties below are optional
                             Cookies = new CookiesProperty {
                                 Forward = "forward",

                                 // the properties below are optional
                                 WhitelistedNames = new [] { "whitelistedNames" }
                             },
                             Headers = new [] { "headers" },
                             QueryStringCacheKeys = new [] { "queryStringCacheKeys" }
                         },
                         FunctionAssociations = new [] { new FunctionAssociationProperty {
                             EventType = "eventType",
                             FunctionArn = "functionArn"
                         } },
                         LambdaFunctionAssociations = new [] { new LambdaFunctionAssociationProperty {
                             EventType = "eventType",
                             IncludeBody = false,
                             LambdaFunctionArn = "lambdaFunctionArn"
                         } },
                         MaxTtl = 123,
                         MinTtl = 123,
                         OriginRequestPolicyId = "originRequestPolicyId",
                         RealtimeLogConfigArn = "realtimeLogConfigArn",
                         ResponseHeadersPolicyId = "responseHeadersPolicyId",
                         SmoothStreaming = false,
                         TrustedKeyGroups = new [] { "trustedKeyGroups" },
                         TrustedSigners = new [] { "trustedSigners" }
                     } },
                     CnamEs = new [] { "cnamEs" },
                     Comment = "comment",
                     ContinuousDeploymentPolicyId = "continuousDeploymentPolicyId",
                     CustomErrorResponses = new [] { new CustomErrorResponseProperty {
                         ErrorCode = 123,

                         // the properties below are optional
                         ErrorCachingMinTtl = 123,
                         ResponseCode = 123,
                         ResponsePagePath = "responsePagePath"
                     } },
                     CustomOrigin = new LegacyCustomOriginProperty {
                         DnsName = "dnsName",
                         OriginProtocolPolicy = "originProtocolPolicy",
                         OriginSslProtocols = new [] { "originSslProtocols" },

                         // the properties below are optional
                         HttpPort = 123,
                         HttpsPort = 123
                     },
                     DefaultRootObject = "defaultRootObject",
                     HttpVersion = "httpVersion",
                     Ipv6Enabled = false,
                     Logging = new LoggingProperty {
                         Bucket = "bucket",

                         // the properties below are optional
                         IncludeCookies = false,
                         Prefix = "prefix"
                     },
                     OriginGroups = new OriginGroupsProperty {
                         Quantity = 123,

                         // the properties below are optional
                         Items = new [] { new OriginGroupProperty {
                             FailoverCriteria = new OriginGroupFailoverCriteriaProperty {
                                 StatusCodes = new StatusCodesProperty {
                                     Items = new [] { 123 },
                                     Quantity = 123
                                 }
                             },
                             Id = "id",
                             Members = new OriginGroupMembersProperty {
                                 Items = new [] { new OriginGroupMemberProperty {
                                     OriginId = "originId"
                                 } },
                                 Quantity = 123
                             }
                         } }
                     },
                     Origins = new [] { new OriginProperty {
                         DomainName = "domainName",
                         Id = "id",

                         // the properties below are optional
                         ConnectionAttempts = 123,
                         ConnectionTimeout = 123,
                         CustomOriginConfig = new CustomOriginConfigProperty {
                             OriginProtocolPolicy = "originProtocolPolicy",

                             // the properties below are optional
                             HttpPort = 123,
                             HttpsPort = 123,
                             OriginKeepaliveTimeout = 123,
                             OriginReadTimeout = 123,
                             OriginSslProtocols = new [] { "originSslProtocols" }
                         },
                         OriginAccessControlId = "originAccessControlId",
                         OriginCustomHeaders = new [] { new OriginCustomHeaderProperty {
                             HeaderName = "headerName",
                             HeaderValue = "headerValue"
                         } },
                         OriginPath = "originPath",
                         OriginShield = new OriginShieldProperty {
                             Enabled = false,
                             OriginShieldRegion = "originShieldRegion"
                         },
                         S3OriginConfig = new S3OriginConfigProperty {
                             OriginAccessIdentity = "originAccessIdentity"
                         }
                     } },
                     PriceClass = "priceClass",
                     Restrictions = new RestrictionsProperty {
                         GeoRestriction = new GeoRestrictionProperty {
                             RestrictionType = "restrictionType",

                             // the properties below are optional
                             Locations = new [] { "locations" }
                         }
                     },
                     S3Origin = new LegacyS3OriginProperty {
                         DnsName = "dnsName",

                         // the properties below are optional
                         OriginAccessIdentity = "originAccessIdentity"
                     },
                     Staging = false,
                     ViewerCertificate = new ViewerCertificateProperty {
                         AcmCertificateArn = "acmCertificateArn",
                         CloudFrontDefaultCertificate = false,
                         IamCertificateId = "iamCertificateId",
                         MinimumProtocolVersion = "minimumProtocolVersion",
                         SslSupportMethod = "sslSupportMethod"
                     },
                     WebAclId = "webAclId"
                 },

                 // the properties below are optional
                 Tags = new [] { new CfnTag {
                     Key = "key",
                     Value = "value"
                 } }
             };

Remarks

Properties

DistributionConfig

The distribution's configuration.

object DistributionConfig { get; }

Property Value

object

Remarks

Tags

A complex type that contains zero or more Tag elements.

ICfnTag[]? Tags { get; }

Property Value

ICfnTag[]

Remarks