CfnDistributionProps Struct
Properties for defining a CfnDistribution.
| Source |
|---|
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';
const cfnDistributionProps: cloudfront.CfnDistributionProps = {
distributionConfig: {
defaultCacheBehavior: {
targetOriginId: 'targetOriginId',
viewerProtocolPolicy: 'viewerProtocolPolicy',
// the properties below are optional
allowedMethods: ['allowedMethods'],
cachedMethods: ['cachedMethods'],
cachePolicyId: 'cachePolicyId',
compress: false,
defaultTtl: 123,
fieldLevelEncryptionId: 'fieldLevelEncryptionId',
forwardedValues: {
queryString: false,
// the properties below are optional
cookies: {
forward: 'forward',
// the properties below are optional
whitelistedNames: ['whitelistedNames'],
},
headers: ['headers'],
queryStringCacheKeys: ['queryStringCacheKeys'],
},
functionAssociations: [{
eventType: 'eventType',
functionArn: 'functionArn',
}],
grpcConfig: {
enabled: false,
},
lambdaFunctionAssociations: [{
eventType: 'eventType',
includeBody: false,
lambdaFunctionArn: 'lambdaFunctionArn',
}],
maxTtl: 123,
minTtl: 123,
originRequestPolicyId: 'originRequestPolicyId',
realtimeLogConfigArn: 'realtimeLogConfigArn',
responseHeadersPolicyId: 'responseHeadersPolicyId',
smoothStreaming: false,
trustedKeyGroups: ['trustedKeyGroups'],
trustedSigners: ['trustedSigners'],
},
enabled: false,
// the properties below are optional
aliases: ['aliases'],
anycastIpListId: 'anycastIpListId',
cacheBehaviors: [{
pathPattern: 'pathPattern',
targetOriginId: 'targetOriginId',
viewerProtocolPolicy: 'viewerProtocolPolicy',
// the properties below are optional
allowedMethods: ['allowedMethods'],
cachedMethods: ['cachedMethods'],
cachePolicyId: 'cachePolicyId',
compress: false,
defaultTtl: 123,
fieldLevelEncryptionId: 'fieldLevelEncryptionId',
forwardedValues: {
queryString: false,
// the properties below are optional
cookies: {
forward: 'forward',
// the properties below are optional
whitelistedNames: ['whitelistedNames'],
},
headers: ['headers'],
queryStringCacheKeys: ['queryStringCacheKeys'],
},
functionAssociations: [{
eventType: 'eventType',
functionArn: 'functionArn',
}],
grpcConfig: {
enabled: false,
},
lambdaFunctionAssociations: [{
eventType: 'eventType',
includeBody: false,
lambdaFunctionArn: 'lambdaFunctionArn',
}],
maxTtl: 123,
minTtl: 123,
originRequestPolicyId: 'originRequestPolicyId',
realtimeLogConfigArn: 'realtimeLogConfigArn',
responseHeadersPolicyId: 'responseHeadersPolicyId',
smoothStreaming: false,
trustedKeyGroups: ['trustedKeyGroups'],
trustedSigners: ['trustedSigners'],
}],
cacheTagConfig: {
headerName: 'headerName',
},
cnamEs: ['cnamEs'],
comment: 'comment',
connectionFunctionAssociation: {
id: 'id',
},
connectionMode: 'connectionMode',
continuousDeploymentPolicyId: 'continuousDeploymentPolicyId',
customErrorResponses: [{
errorCode: 123,
// the properties below are optional
errorCachingMinTtl: 123,
responseCode: 123,
responsePagePath: 'responsePagePath',
}],
customOrigin: {
dnsName: 'dnsName',
originProtocolPolicy: 'originProtocolPolicy',
originSslProtocols: ['originSslProtocols'],
// the properties below are optional
httpPort: 123,
httpsPort: 123,
},
defaultRootObject: 'defaultRootObject',
httpVersion: 'httpVersion',
ipv6Enabled: false,
logging: {
bucket: 'bucket',
includeCookies: false,
prefix: 'prefix',
},
originGroups: {
quantity: 123,
// the properties below are optional
items: [{
failoverCriteria: {
statusCodes: {
items: [123],
quantity: 123,
},
},
id: 'id',
members: {
items: [{
originId: 'originId',
}],
quantity: 123,
},
// the properties below are optional
selectionCriteria: 'selectionCriteria',
}],
},
origins: [{
domainName: 'domainName',
id: 'id',
// the properties below are optional
connectionAttempts: 123,
connectionTimeout: 123,
customOriginConfig: {
originProtocolPolicy: 'originProtocolPolicy',
// the properties below are optional
httpPort: 123,
httpsPort: 123,
ipAddressType: 'ipAddressType',
originKeepaliveTimeout: 123,
originMtlsConfig: {
clientCertificateArn: 'clientCertificateArn',
},
originReadTimeout: 123,
originSslProtocols: ['originSslProtocols'],
},
originAccessControlId: 'originAccessControlId',
originCustomHeaders: [{
headerName: 'headerName',
headerValue: 'headerValue',
}],
originPath: 'originPath',
originShield: {
enabled: false,
originShieldRegion: 'originShieldRegion',
},
responseCompletionTimeout: 123,
s3OriginConfig: {
originAccessIdentity: 'originAccessIdentity',
originReadTimeout: 123,
},
vpcOriginConfig: {
vpcOriginId: 'vpcOriginId',
// the properties below are optional
originKeepaliveTimeout: 123,
originReadTimeout: 123,
ownerAccountId: 'ownerAccountId',
},
}],
priceClass: 'priceClass',
restrictions: {
geoRestriction: {
restrictionType: 'restrictionType',
// the properties below are optional
locations: ['locations'],
},
},
s3Origin: {
dnsName: 'dnsName',
// the properties below are optional
originAccessIdentity: 'originAccessIdentity',
},
staging: false,
tenantConfig: {
parameterDefinitions: [{
definition: {
stringSchema: {
required: false,
// the properties below are optional
comment: 'comment',
defaultValue: 'defaultValue',
},
},
name: 'name',
}],
},
viewerCertificate: {
acmCertificateArn: 'acmCertificateArn',
cloudFrontDefaultCertificate: false,
iamCertificateId: 'iamCertificateId',
minimumProtocolVersion: 'minimumProtocolVersion',
sslSupportMethod: 'sslSupportMethod',
},
viewerMtlsConfig: {
mode: 'mode',
trustStoreConfig: {
trustStoreId: 'trustStoreId',
// the properties below are optional
advertiseTrustStoreCaNames: false,
ignoreCertificateExpiry: false,
},
},
webAclId: 'webAclId',
},
// the properties below are optional
tags: [{
key: 'key',
value: 'value',
}],
};
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudfront as cloudfront
cfn_distribution_props = cloudfront.CfnDistributionProps(
distribution_config=cloudfront.CfnDistribution.DistributionConfigProperty(
default_cache_behavior=cloudfront.CfnDistribution.DefaultCacheBehaviorProperty(
target_origin_id="targetOriginId",
viewer_protocol_policy="viewerProtocolPolicy",
# the properties below are optional
allowed_methods=["allowedMethods"],
cached_methods=["cachedMethods"],
cache_policy_id="cachePolicyId",
compress=False,
default_ttl=123,
field_level_encryption_id="fieldLevelEncryptionId",
forwarded_values=cloudfront.CfnDistribution.ForwardedValuesProperty(
query_string=False,
# the properties below are optional
cookies=cloudfront.CfnDistribution.CookiesProperty(
forward="forward",
# the properties below are optional
whitelisted_names=["whitelistedNames"]
),
headers=["headers"],
query_string_cache_keys=["queryStringCacheKeys"]
),
function_associations=[cloudfront.CfnDistribution.FunctionAssociationProperty(
event_type="eventType",
function_arn="functionArn"
)],
grpc_config=cloudfront.CfnDistribution.GrpcConfigProperty(
enabled=False
),
lambda_function_associations=[cloudfront.CfnDistribution.LambdaFunctionAssociationProperty(
event_type="eventType",
include_body=False,
lambda_function_arn="lambdaFunctionArn"
)],
max_ttl=123,
min_ttl=123,
origin_request_policy_id="originRequestPolicyId",
realtime_log_config_arn="realtimeLogConfigArn",
response_headers_policy_id="responseHeadersPolicyId",
smooth_streaming=False,
trusted_key_groups=["trustedKeyGroups"],
trusted_signers=["trustedSigners"]
),
enabled=False,
# the properties below are optional
aliases=["aliases"],
anycast_ip_list_id="anycastIpListId",
cache_behaviors=[cloudfront.CfnDistribution.CacheBehaviorProperty(
path_pattern="pathPattern",
target_origin_id="targetOriginId",
viewer_protocol_policy="viewerProtocolPolicy",
# the properties below are optional
allowed_methods=["allowedMethods"],
cached_methods=["cachedMethods"],
cache_policy_id="cachePolicyId",
compress=False,
default_ttl=123,
field_level_encryption_id="fieldLevelEncryptionId",
forwarded_values=cloudfront.CfnDistribution.ForwardedValuesProperty(
query_string=False,
# the properties below are optional
cookies=cloudfront.CfnDistribution.CookiesProperty(
forward="forward",
# the properties below are optional
whitelisted_names=["whitelistedNames"]
),
headers=["headers"],
query_string_cache_keys=["queryStringCacheKeys"]
),
function_associations=[cloudfront.CfnDistribution.FunctionAssociationProperty(
event_type="eventType",
function_arn="functionArn"
)],
grpc_config=cloudfront.CfnDistribution.GrpcConfigProperty(
enabled=False
),
lambda_function_associations=[cloudfront.CfnDistribution.LambdaFunctionAssociationProperty(
event_type="eventType",
include_body=False,
lambda_function_arn="lambdaFunctionArn"
)],
max_ttl=123,
min_ttl=123,
origin_request_policy_id="originRequestPolicyId",
realtime_log_config_arn="realtimeLogConfigArn",
response_headers_policy_id="responseHeadersPolicyId",
smooth_streaming=False,
trusted_key_groups=["trustedKeyGroups"],
trusted_signers=["trustedSigners"]
)],
cache_tag_config=cloudfront.CfnDistribution.CacheTagConfigProperty(
header_name="headerName"
),
cnam_es=["cnamEs"],
comment="comment",
connection_function_association=cloudfront.CfnDistribution.ConnectionFunctionAssociationProperty(
id="id"
),
connection_mode="connectionMode",
continuous_deployment_policy_id="continuousDeploymentPolicyId",
custom_error_responses=[cloudfront.CfnDistribution.CustomErrorResponseProperty(
error_code=123,
# the properties below are optional
error_caching_min_ttl=123,
response_code=123,
response_page_path="responsePagePath"
)],
custom_origin=cloudfront.CfnDistribution.LegacyCustomOriginProperty(
dns_name="dnsName",
origin_protocol_policy="originProtocolPolicy",
origin_ssl_protocols=["originSslProtocols"],
# the properties below are optional
http_port=123,
https_port=123
),
default_root_object="defaultRootObject",
http_version="httpVersion",
ipv6_enabled=False,
logging=cloudfront.CfnDistribution.LoggingProperty(
bucket="bucket",
include_cookies=False,
prefix="prefix"
),
origin_groups=cloudfront.CfnDistribution.OriginGroupsProperty(
quantity=123,
# the properties below are optional
items=[cloudfront.CfnDistribution.OriginGroupProperty(
failover_criteria=cloudfront.CfnDistribution.OriginGroupFailoverCriteriaProperty(
status_codes=cloudfront.CfnDistribution.StatusCodesProperty(
items=[123],
quantity=123
)
),
id="id",
members=cloudfront.CfnDistribution.OriginGroupMembersProperty(
items=[cloudfront.CfnDistribution.OriginGroupMemberProperty(
origin_id="originId"
)],
quantity=123
),
# the properties below are optional
selection_criteria="selectionCriteria"
)]
),
origins=[cloudfront.CfnDistribution.OriginProperty(
domain_name="domainName",
id="id",
# the properties below are optional
connection_attempts=123,
connection_timeout=123,
custom_origin_config=cloudfront.CfnDistribution.CustomOriginConfigProperty(
origin_protocol_policy="originProtocolPolicy",
# the properties below are optional
http_port=123,
https_port=123,
ip_address_type="ipAddressType",
origin_keepalive_timeout=123,
origin_mtls_config=cloudfront.CfnDistribution.OriginMtlsConfigProperty(
client_certificate_arn="clientCertificateArn"
),
origin_read_timeout=123,
origin_ssl_protocols=["originSslProtocols"]
),
origin_access_control_id="originAccessControlId",
origin_custom_headers=[cloudfront.CfnDistribution.OriginCustomHeaderProperty(
header_name="headerName",
header_value="headerValue"
)],
origin_path="originPath",
origin_shield=cloudfront.CfnDistribution.OriginShieldProperty(
enabled=False,
origin_shield_region="originShieldRegion"
),
response_completion_timeout=123,
s3_origin_config=cloudfront.CfnDistribution.S3OriginConfigProperty(
origin_access_identity="originAccessIdentity",
origin_read_timeout=123
),
vpc_origin_config=cloudfront.CfnDistribution.VpcOriginConfigProperty(
vpc_origin_id="vpcOriginId",
# the properties below are optional
origin_keepalive_timeout=123,
origin_read_timeout=123,
owner_account_id="ownerAccountId"
)
)],
price_class="priceClass",
restrictions=cloudfront.CfnDistribution.RestrictionsProperty(
geo_restriction=cloudfront.CfnDistribution.GeoRestrictionProperty(
restriction_type="restrictionType",
# the properties below are optional
locations=["locations"]
)
),
s3_origin=cloudfront.CfnDistribution.LegacyS3OriginProperty(
dns_name="dnsName",
# the properties below are optional
origin_access_identity="originAccessIdentity"
),
staging=False,
tenant_config=cloudfront.CfnDistribution.TenantConfigProperty(
parameter_definitions=[cloudfront.CfnDistribution.ParameterDefinitionProperty(
definition=cloudfront.CfnDistribution.DefinitionProperty(
string_schema=cloudfront.CfnDistribution.StringSchemaProperty(
required=False,
# the properties below are optional
comment="comment",
default_value="defaultValue"
)
),
name="name"
)]
),
viewer_certificate=cloudfront.CfnDistribution.ViewerCertificateProperty(
acm_certificate_arn="acmCertificateArn",
cloud_front_default_certificate=False,
iam_certificate_id="iamCertificateId",
minimum_protocol_version="minimumProtocolVersion",
ssl_support_method="sslSupportMethod"
),
viewer_mtls_config=cloudfront.CfnDistribution.ViewerMtlsConfigProperty(
mode="mode",
trust_store_config=cloudfront.CfnDistribution.TrustStoreConfigProperty(
trust_store_id="trustStoreId",
# the properties below are optional
advertise_trust_store_ca_names=False,
ignore_certificate_expiry=False
)
),
web_acl_id="webAclId"
),
# the properties below are optional
tags=[CfnTag(
key="key",
value="value"
)]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudfront.*;
CfnDistributionProps cfnDistributionProps = CfnDistributionProps.builder()
.distributionConfig(DistributionConfigProperty.builder()
.defaultCacheBehavior(DefaultCacheBehaviorProperty.builder()
.targetOriginId("targetOriginId")
.viewerProtocolPolicy("viewerProtocolPolicy")
// the properties below are optional
.allowedMethods(List.of("allowedMethods"))
.cachedMethods(List.of("cachedMethods"))
.cachePolicyId("cachePolicyId")
.compress(false)
.defaultTtl(123)
.fieldLevelEncryptionId("fieldLevelEncryptionId")
.forwardedValues(ForwardedValuesProperty.builder()
.queryString(false)
// the properties below are optional
.cookies(CookiesProperty.builder()
.forward("forward")
// the properties below are optional
.whitelistedNames(List.of("whitelistedNames"))
.build())
.headers(List.of("headers"))
.queryStringCacheKeys(List.of("queryStringCacheKeys"))
.build())
.functionAssociations(List.of(FunctionAssociationProperty.builder()
.eventType("eventType")
.functionArn("functionArn")
.build()))
.grpcConfig(GrpcConfigProperty.builder()
.enabled(false)
.build())
.lambdaFunctionAssociations(List.of(LambdaFunctionAssociationProperty.builder()
.eventType("eventType")
.includeBody(false)
.lambdaFunctionArn("lambdaFunctionArn")
.build()))
.maxTtl(123)
.minTtl(123)
.originRequestPolicyId("originRequestPolicyId")
.realtimeLogConfigArn("realtimeLogConfigArn")
.responseHeadersPolicyId("responseHeadersPolicyId")
.smoothStreaming(false)
.trustedKeyGroups(List.of("trustedKeyGroups"))
.trustedSigners(List.of("trustedSigners"))
.build())
.enabled(false)
// the properties below are optional
.aliases(List.of("aliases"))
.anycastIpListId("anycastIpListId")
.cacheBehaviors(List.of(CacheBehaviorProperty.builder()
.pathPattern("pathPattern")
.targetOriginId("targetOriginId")
.viewerProtocolPolicy("viewerProtocolPolicy")
// the properties below are optional
.allowedMethods(List.of("allowedMethods"))
.cachedMethods(List.of("cachedMethods"))
.cachePolicyId("cachePolicyId")
.compress(false)
.defaultTtl(123)
.fieldLevelEncryptionId("fieldLevelEncryptionId")
.forwardedValues(ForwardedValuesProperty.builder()
.queryString(false)
// the properties below are optional
.cookies(CookiesProperty.builder()
.forward("forward")
// the properties below are optional
.whitelistedNames(List.of("whitelistedNames"))
.build())
.headers(List.of("headers"))
.queryStringCacheKeys(List.of("queryStringCacheKeys"))
.build())
.functionAssociations(List.of(FunctionAssociationProperty.builder()
.eventType("eventType")
.functionArn("functionArn")
.build()))
.grpcConfig(GrpcConfigProperty.builder()
.enabled(false)
.build())
.lambdaFunctionAssociations(List.of(LambdaFunctionAssociationProperty.builder()
.eventType("eventType")
.includeBody(false)
.lambdaFunctionArn("lambdaFunctionArn")
.build()))
.maxTtl(123)
.minTtl(123)
.originRequestPolicyId("originRequestPolicyId")
.realtimeLogConfigArn("realtimeLogConfigArn")
.responseHeadersPolicyId("responseHeadersPolicyId")
.smoothStreaming(false)
.trustedKeyGroups(List.of("trustedKeyGroups"))
.trustedSigners(List.of("trustedSigners"))
.build()))
.cacheTagConfig(CacheTagConfigProperty.builder()
.headerName("headerName")
.build())
.cnamEs(List.of("cnamEs"))
.comment("comment")
.connectionFunctionAssociation(ConnectionFunctionAssociationProperty.builder()
.id("id")
.build())
.connectionMode("connectionMode")
.continuousDeploymentPolicyId("continuousDeploymentPolicyId")
.customErrorResponses(List.of(CustomErrorResponseProperty.builder()
.errorCode(123)
// the properties below are optional
.errorCachingMinTtl(123)
.responseCode(123)
.responsePagePath("responsePagePath")
.build()))
.customOrigin(LegacyCustomOriginProperty.builder()
.dnsName("dnsName")
.originProtocolPolicy("originProtocolPolicy")
.originSslProtocols(List.of("originSslProtocols"))
// the properties below are optional
.httpPort(123)
.httpsPort(123)
.build())
.defaultRootObject("defaultRootObject")
.httpVersion("httpVersion")
.ipv6Enabled(false)
.logging(LoggingProperty.builder()
.bucket("bucket")
.includeCookies(false)
.prefix("prefix")
.build())
.originGroups(OriginGroupsProperty.builder()
.quantity(123)
// the properties below are optional
.items(List.of(OriginGroupProperty.builder()
.failoverCriteria(OriginGroupFailoverCriteriaProperty.builder()
.statusCodes(StatusCodesProperty.builder()
.items(List.of(123))
.quantity(123)
.build())
.build())
.id("id")
.members(OriginGroupMembersProperty.builder()
.items(List.of(OriginGroupMemberProperty.builder()
.originId("originId")
.build()))
.quantity(123)
.build())
// the properties below are optional
.selectionCriteria("selectionCriteria")
.build()))
.build())
.origins(List.of(OriginProperty.builder()
.domainName("domainName")
.id("id")
// the properties below are optional
.connectionAttempts(123)
.connectionTimeout(123)
.customOriginConfig(CustomOriginConfigProperty.builder()
.originProtocolPolicy("originProtocolPolicy")
// the properties below are optional
.httpPort(123)
.httpsPort(123)
.ipAddressType("ipAddressType")
.originKeepaliveTimeout(123)
.originMtlsConfig(OriginMtlsConfigProperty.builder()
.clientCertificateArn("clientCertificateArn")
.build())
.originReadTimeout(123)
.originSslProtocols(List.of("originSslProtocols"))
.build())
.originAccessControlId("originAccessControlId")
.originCustomHeaders(List.of(OriginCustomHeaderProperty.builder()
.headerName("headerName")
.headerValue("headerValue")
.build()))
.originPath("originPath")
.originShield(OriginShieldProperty.builder()
.enabled(false)
.originShieldRegion("originShieldRegion")
.build())
.responseCompletionTimeout(123)
.s3OriginConfig(S3OriginConfigProperty.builder()
.originAccessIdentity("originAccessIdentity")
.originReadTimeout(123)
.build())
.vpcOriginConfig(VpcOriginConfigProperty.builder()
.vpcOriginId("vpcOriginId")
// the properties below are optional
.originKeepaliveTimeout(123)
.originReadTimeout(123)
.ownerAccountId("ownerAccountId")
.build())
.build()))
.priceClass("priceClass")
.restrictions(RestrictionsProperty.builder()
.geoRestriction(GeoRestrictionProperty.builder()
.restrictionType("restrictionType")
// the properties below are optional
.locations(List.of("locations"))
.build())
.build())
.s3Origin(LegacyS3OriginProperty.builder()
.dnsName("dnsName")
// the properties below are optional
.originAccessIdentity("originAccessIdentity")
.build())
.staging(false)
.tenantConfig(TenantConfigProperty.builder()
.parameterDefinitions(List.of(ParameterDefinitionProperty.builder()
.definition(DefinitionProperty.builder()
.stringSchema(StringSchemaProperty.builder()
.required(false)
// the properties below are optional
.comment("comment")
.defaultValue("defaultValue")
.build())
.build())
.name("name")
.build()))
.build())
.viewerCertificate(ViewerCertificateProperty.builder()
.acmCertificateArn("acmCertificateArn")
.cloudFrontDefaultCertificate(false)
.iamCertificateId("iamCertificateId")
.minimumProtocolVersion("minimumProtocolVersion")
.sslSupportMethod("sslSupportMethod")
.build())
.viewerMtlsConfig(ViewerMtlsConfigProperty.builder()
.mode("mode")
.trustStoreConfig(TrustStoreConfigProperty.builder()
.trustStoreId("trustStoreId")
// the properties below are optional
.advertiseTrustStoreCaNames(false)
.ignoreCertificateExpiry(false)
.build())
.build())
.webAclId("webAclId")
.build())
// the properties below are optional
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// 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"
} },
GrpcConfig = new GrpcConfigProperty {
Enabled = false
},
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" },
AnycastIpListId = "anycastIpListId",
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"
} },
GrpcConfig = new GrpcConfigProperty {
Enabled = false
},
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" }
} },
CacheTagConfig = new CacheTagConfigProperty {
HeaderName = "headerName"
},
CnamEs = new [] { "cnamEs" },
Comment = "comment",
ConnectionFunctionAssociation = new ConnectionFunctionAssociationProperty {
Id = "id"
},
ConnectionMode = "connectionMode",
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",
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
},
// the properties below are optional
SelectionCriteria = "selectionCriteria"
} }
},
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,
IpAddressType = "ipAddressType",
OriginKeepaliveTimeout = 123,
OriginMtlsConfig = new OriginMtlsConfigProperty {
ClientCertificateArn = "clientCertificateArn"
},
OriginReadTimeout = 123,
OriginSslProtocols = new [] { "originSslProtocols" }
},
OriginAccessControlId = "originAccessControlId",
OriginCustomHeaders = new [] { new OriginCustomHeaderProperty {
HeaderName = "headerName",
HeaderValue = "headerValue"
} },
OriginPath = "originPath",
OriginShield = new OriginShieldProperty {
Enabled = false,
OriginShieldRegion = "originShieldRegion"
},
ResponseCompletionTimeout = 123,
S3OriginConfig = new S3OriginConfigProperty {
OriginAccessIdentity = "originAccessIdentity",
OriginReadTimeout = 123
},
VpcOriginConfig = new VpcOriginConfigProperty {
VpcOriginId = "vpcOriginId",
// the properties below are optional
OriginKeepaliveTimeout = 123,
OriginReadTimeout = 123,
OwnerAccountId = "ownerAccountId"
}
} },
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,
TenantConfig = new TenantConfigProperty {
ParameterDefinitions = new [] { new ParameterDefinitionProperty {
Definition = new DefinitionProperty {
StringSchema = new StringSchemaProperty {
Required = false,
// the properties below are optional
Comment = "comment",
DefaultValue = "defaultValue"
}
},
Name = "name"
} }
},
ViewerCertificate = new ViewerCertificateProperty {
AcmCertificateArn = "acmCertificateArn",
CloudFrontDefaultCertificate = false,
IamCertificateId = "iamCertificateId",
MinimumProtocolVersion = "minimumProtocolVersion",
SslSupportMethod = "sslSupportMethod"
},
ViewerMtlsConfig = new ViewerMtlsConfigProperty {
Mode = "mode",
TrustStoreConfig = new TrustStoreConfigProperty {
TrustStoreId = "trustStoreId",
// the properties below are optional
AdvertiseTrustStoreCaNames = false,
IgnoreCertificateExpiry = false
}
},
WebAclId = "webAclId"
},
// the properties below are optional
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
cfnDistributionProps := &CfnDistributionProps{
DistributionConfig: &DistributionConfigProperty{
DefaultCacheBehavior: &DefaultCacheBehaviorProperty{
TargetOriginId: jsii.String("targetOriginId"),
ViewerProtocolPolicy: jsii.String("viewerProtocolPolicy"),
// the properties below are optional
AllowedMethods: []*string{
jsii.String("allowedMethods"),
},
CachedMethods: []*string{
jsii.String("cachedMethods"),
},
CachePolicyId: jsii.String("cachePolicyId"),
Compress: jsii.Boolean(false),
DefaultTtl: jsii.Number(123),
FieldLevelEncryptionId: jsii.String("fieldLevelEncryptionId"),
ForwardedValues: &ForwardedValuesProperty{
QueryString: jsii.Boolean(false),
// the properties below are optional
Cookies: &CookiesProperty{
Forward: jsii.String("forward"),
// the properties below are optional
WhitelistedNames: []*string{
jsii.String("whitelistedNames"),
},
},
Headers: []*string{
jsii.String("headers"),
},
QueryStringCacheKeys: []*string{
jsii.String("queryStringCacheKeys"),
},
},
FunctionAssociations: []interface{}{
&FunctionAssociationProperty{
EventType: jsii.String("eventType"),
FunctionArn: jsii.String("functionArn"),
},
},
GrpcConfig: &GrpcConfigProperty{
Enabled: jsii.Boolean(false),
},
LambdaFunctionAssociations: []interface{}{
&LambdaFunctionAssociationProperty{
EventType: jsii.String("eventType"),
IncludeBody: jsii.Boolean(false),
LambdaFunctionArn: jsii.String("lambdaFunctionArn"),
},
},
MaxTtl: jsii.Number(123),
MinTtl: jsii.Number(123),
OriginRequestPolicyId: jsii.String("originRequestPolicyId"),
RealtimeLogConfigArn: jsii.String("realtimeLogConfigArn"),
ResponseHeadersPolicyId: jsii.String("responseHeadersPolicyId"),
SmoothStreaming: jsii.Boolean(false),
TrustedKeyGroups: []*string{
jsii.String("trustedKeyGroups"),
},
TrustedSigners: []*string{
jsii.String("trustedSigners"),
},
},
Enabled: jsii.Boolean(false),
// the properties below are optional
Aliases: []*string{
jsii.String("aliases"),
},
AnycastIpListId: jsii.String("anycastIpListId"),
CacheBehaviors: []interface{}{
&CacheBehaviorProperty{
PathPattern: jsii.String("pathPattern"),
TargetOriginId: jsii.String("targetOriginId"),
ViewerProtocolPolicy: jsii.String("viewerProtocolPolicy"),
// the properties below are optional
AllowedMethods: []*string{
jsii.String("allowedMethods"),
},
CachedMethods: []*string{
jsii.String("cachedMethods"),
},
CachePolicyId: jsii.String("cachePolicyId"),
Compress: jsii.Boolean(false),
DefaultTtl: jsii.Number(123),
FieldLevelEncryptionId: jsii.String("fieldLevelEncryptionId"),
ForwardedValues: &ForwardedValuesProperty{
QueryString: jsii.Boolean(false),
// the properties below are optional
Cookies: &CookiesProperty{
Forward: jsii.String("forward"),
// the properties below are optional
WhitelistedNames: []*string{
jsii.String("whitelistedNames"),
},
},
Headers: []*string{
jsii.String("headers"),
},
QueryStringCacheKeys: []*string{
jsii.String("queryStringCacheKeys"),
},
},
FunctionAssociations: []interface{}{
&FunctionAssociationProperty{
EventType: jsii.String("eventType"),
FunctionArn: jsii.String("functionArn"),
},
},
GrpcConfig: &GrpcConfigProperty{
Enabled: jsii.Boolean(false),
},
LambdaFunctionAssociations: []interface{}{
&LambdaFunctionAssociationProperty{
EventType: jsii.String("eventType"),
IncludeBody: jsii.Boolean(false),
LambdaFunctionArn: jsii.String("lambdaFunctionArn"),
},
},
MaxTtl: jsii.Number(123),
MinTtl: jsii.Number(123),
OriginRequestPolicyId: jsii.String("originRequestPolicyId"),
RealtimeLogConfigArn: jsii.String("realtimeLogConfigArn"),
ResponseHeadersPolicyId: jsii.String("responseHeadersPolicyId"),
SmoothStreaming: jsii.Boolean(false),
TrustedKeyGroups: []*string{
jsii.String("trustedKeyGroups"),
},
TrustedSigners: []*string{
jsii.String("trustedSigners"),
},
},
},
CacheTagConfig: &CacheTagConfigProperty{
HeaderName: jsii.String("headerName"),
},
CnamEs: []*string{
jsii.String("cnamEs"),
},
Comment: jsii.String("comment"),
ConnectionFunctionAssociation: &ConnectionFunctionAssociationProperty{
Id: jsii.String("id"),
},
ConnectionMode: jsii.String("connectionMode"),
ContinuousDeploymentPolicyId: jsii.String("continuousDeploymentPolicyId"),
CustomErrorResponses: []interface{}{
&CustomErrorResponseProperty{
ErrorCode: jsii.Number(123),
// the properties below are optional
ErrorCachingMinTtl: jsii.Number(123),
ResponseCode: jsii.Number(123),
ResponsePagePath: jsii.String("responsePagePath"),
},
},
CustomOrigin: &LegacyCustomOriginProperty{
DnsName: jsii.String("dnsName"),
OriginProtocolPolicy: jsii.String("originProtocolPolicy"),
OriginSslProtocols: []*string{
jsii.String("originSslProtocols"),
},
// the properties below are optional
HttpPort: jsii.Number(123),
HttpsPort: jsii.Number(123),
},
DefaultRootObject: jsii.String("defaultRootObject"),
HttpVersion: jsii.String("httpVersion"),
Ipv6Enabled: jsii.Boolean(false),
Logging: &LoggingProperty{
Bucket: jsii.String("bucket"),
IncludeCookies: jsii.Boolean(false),
Prefix: jsii.String("prefix"),
},
OriginGroups: &OriginGroupsProperty{
Quantity: jsii.Number(123),
// the properties below are optional
Items: []interface{}{
&OriginGroupProperty{
FailoverCriteria: &OriginGroupFailoverCriteriaProperty{
StatusCodes: &StatusCodesProperty{
Items: []interface{}{
jsii.Number(123),
},
Quantity: jsii.Number(123),
},
},
Id: jsii.String("id"),
Members: &OriginGroupMembersProperty{
Items: []interface{}{
&OriginGroupMemberProperty{
OriginId: jsii.String("originId"),
},
},
Quantity: jsii.Number(123),
},
// the properties below are optional
SelectionCriteria: jsii.String("selectionCriteria"),
},
},
},
Origins: []interface{}{
&OriginProperty{
DomainName: jsii.String("domainName"),
Id: jsii.String("id"),
// the properties below are optional
ConnectionAttempts: jsii.Number(123),
ConnectionTimeout: jsii.Number(123),
CustomOriginConfig: &CustomOriginConfigProperty{
OriginProtocolPolicy: jsii.String("originProtocolPolicy"),
// the properties below are optional
HttpPort: jsii.Number(123),
HttpsPort: jsii.Number(123),
IpAddressType: jsii.String("ipAddressType"),
OriginKeepaliveTimeout: jsii.Number(123),
OriginMtlsConfig: &OriginMtlsConfigProperty{
ClientCertificateArn: jsii.String("clientCertificateArn"),
},
OriginReadTimeout: jsii.Number(123),
OriginSslProtocols: []*string{
jsii.String("originSslProtocols"),
},
},
OriginAccessControlId: jsii.String("originAccessControlId"),
OriginCustomHeaders: []interface{}{
&OriginCustomHeaderProperty{
HeaderName: jsii.String("headerName"),
HeaderValue: jsii.String("headerValue"),
},
},
OriginPath: jsii.String("originPath"),
OriginShield: &OriginShieldProperty{
Enabled: jsii.Boolean(false),
OriginShieldRegion: jsii.String("originShieldRegion"),
},
ResponseCompletionTimeout: jsii.Number(123),
S3OriginConfig: &S3OriginConfigProperty{
OriginAccessIdentity: jsii.String("originAccessIdentity"),
OriginReadTimeout: jsii.Number(123),
},
VpcOriginConfig: &VpcOriginConfigProperty{
VpcOriginId: jsii.String("vpcOriginId"),
// the properties below are optional
OriginKeepaliveTimeout: jsii.Number(123),
OriginReadTimeout: jsii.Number(123),
OwnerAccountId: jsii.String("ownerAccountId"),
},
},
},
PriceClass: jsii.String("priceClass"),
Restrictions: &RestrictionsProperty{
GeoRestriction: &GeoRestrictionProperty{
RestrictionType: jsii.String("restrictionType"),
// the properties below are optional
Locations: []*string{
jsii.String("locations"),
},
},
},
S3Origin: &LegacyS3OriginProperty{
DnsName: jsii.String("dnsName"),
// the properties below are optional
OriginAccessIdentity: jsii.String("originAccessIdentity"),
},
Staging: jsii.Boolean(false),
TenantConfig: &TenantConfigProperty{
ParameterDefinitions: []interface{}{
&ParameterDefinitionProperty{
Definition: &DefinitionProperty{
StringSchema: &StringSchemaProperty{
Required: jsii.Boolean(false),
// the properties below are optional
Comment: jsii.String("comment"),
DefaultValue: jsii.String("defaultValue"),
},
},
Name: jsii.String("name"),
},
},
},
ViewerCertificate: &ViewerCertificateProperty{
AcmCertificateArn: jsii.String("acmCertificateArn"),
CloudFrontDefaultCertificate: jsii.Boolean(false),
IamCertificateId: jsii.String("iamCertificateId"),
MinimumProtocolVersion: jsii.String("minimumProtocolVersion"),
SslSupportMethod: jsii.String("sslSupportMethod"),
},
ViewerMtlsConfig: &ViewerMtlsConfigProperty{
Mode: jsii.String("mode"),
TrustStoreConfig: &TrustStoreConfigProperty{
TrustStoreId: jsii.String("trustStoreId"),
// the properties below are optional
AdvertiseTrustStoreCaNames: jsii.Boolean(false),
IgnoreCertificateExpiry: jsii.Boolean(false),
},
},
WebAclId: jsii.String("webAclId"),
},
// the properties below are optional
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
}
Properties
distributionConfigIResolvable | CfnDistribution.distribution_configtyping.Union[IResolvable, DistributionConfigProperty]distributionConfigIResolvableDistributionConfigIResolvableDistributionConfiginterface{} required #The distribution's configuration.