@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-11T17:58:48.660Z") @Stability(value=Stable) public class CfnDistribution extends CfnResource implements IInspectable
A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.
Example:
// 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.*;
CfnDistribution cfnDistribution = CfnDistribution.Builder.create(this, "MyCfnDistribution")
.distributionConfig(DistributionConfigProperty.builder()
.enabled(false)
// the properties below are optional
.aliases(List.of("aliases"))
.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()))
.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()))
.cnamEs(List.of("cnamEs"))
.comment("comment")
.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())
.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()))
.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())
.defaultRootObject("defaultRootObject")
.httpVersion("httpVersion")
.ipv6Enabled(false)
.logging(LoggingProperty.builder()
.bucket("bucket")
// the properties below are optional
.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())
.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)
.originKeepaliveTimeout(123)
.originReadTimeout(123)
.originSslProtocols(List.of("originSslProtocols"))
.build())
.originCustomHeaders(List.of(OriginCustomHeaderProperty.builder()
.headerName("headerName")
.headerValue("headerValue")
.build()))
.originPath("originPath")
.originShield(OriginShieldProperty.builder()
.enabled(false)
.originShieldRegion("originShieldRegion")
.build())
.s3OriginConfig(S3OriginConfigProperty.builder()
.originAccessIdentity("originAccessIdentity")
.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())
.viewerCertificate(ViewerCertificateProperty.builder()
.acmCertificateArn("acmCertificateArn")
.cloudFrontDefaultCertificate(false)
.iamCertificateId("iamCertificateId")
.minimumProtocolVersion("minimumProtocolVersion")
.sslSupportMethod("sslSupportMethod")
.build())
.webAclId("webAclId")
.build())
// the properties below are optional
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnDistribution.Builder
A fluent builder for
CfnDistribution. |
static interface |
CfnDistribution.CacheBehaviorProperty
A complex type that describes how CloudFront processes requests.
|
static interface |
CfnDistribution.CookiesProperty
This field is deprecated.
|
static interface |
CfnDistribution.CustomErrorResponseProperty
A complex type that controls:.
|
static interface |
CfnDistribution.CustomOriginConfigProperty
A custom origin.
|
static interface |
CfnDistribution.DefaultCacheBehaviorProperty
A complex type that describes the default cache behavior if you don’t specify a `CacheBehavior` element or if request URLs don’t match any of the values of `PathPattern` in `CacheBehavior` elements.
|
static interface |
CfnDistribution.DistributionConfigProperty
A distribution configuration.
|
static interface |
CfnDistribution.ForwardedValuesProperty
This field is deprecated.
|
static interface |
CfnDistribution.FunctionAssociationProperty
A CloudFront function that is associated with a cache behavior in a CloudFront distribution.
|
static interface |
CfnDistribution.GeoRestrictionProperty
A complex type that controls the countries in which your content is distributed.
|
static interface |
CfnDistribution.LambdaFunctionAssociationProperty
A complex type that contains a Lambda@Edge function association.
|
static interface |
CfnDistribution.LegacyCustomOriginProperty
Example:
|
static interface |
CfnDistribution.LegacyS3OriginProperty
Example:
|
static interface |
CfnDistribution.LoggingProperty
A complex type that controls whether access logs are written for the distribution.
|
static interface |
CfnDistribution.OriginCustomHeaderProperty
A complex type that contains `HeaderName` and `HeaderValue` elements, if any, for this distribution.
|
static interface |
CfnDistribution.OriginGroupFailoverCriteriaProperty
A complex data type that includes information about the failover criteria for an origin group, including the status codes for which CloudFront will failover from the primary origin to the second origin.
|
static interface |
CfnDistribution.OriginGroupMemberProperty
An origin in an origin group.
|
static interface |
CfnDistribution.OriginGroupMembersProperty
A complex data type for the origins included in an origin group.
|
static interface |
CfnDistribution.OriginGroupProperty
An origin group includes two origins (a primary origin and a second origin to failover to) and a failover criteria that you specify.
|
static interface |
CfnDistribution.OriginGroupsProperty
A complex data type for the origin groups specified for a distribution.
|
static interface |
CfnDistribution.OriginProperty
An origin.
|
static interface |
CfnDistribution.OriginShieldProperty
CloudFront Origin Shield.
|
static interface |
CfnDistribution.RestrictionsProperty
A complex type that identifies ways in which you want to restrict distribution of your content.
|
static interface |
CfnDistribution.S3OriginConfigProperty
A complex type that contains information about the Amazon S3 origin.
|
static interface |
CfnDistribution.StatusCodesProperty
A complex data type for the status codes that you specify that, when returned by a primary origin, trigger CloudFront to failover to a second origin.
|
static interface |
CfnDistribution.ViewerCertificateProperty
A complex type that determines the distribution’s SSL/TLS configuration for communicating with viewers.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$ProxyIConstruct.Jsii$Default| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnDistribution(Construct scope,
String id,
CfnDistributionProps props)
Create a new `AWS::CloudFront::Distribution`.
|
protected |
CfnDistribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnDistribution(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrDomainName()
The domain name of the resource, such as `d111111abcdef8.cloudfront.net` .
|
String |
getAttrId() |
protected Map<String,Object> |
getCfnProperties() |
Object |
getDistributionConfig()
The current configuration information for the distribution.
|
TagManager |
getTags()
A complex type that contains zero or more `Tag` elements.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setDistributionConfig(CfnDistribution.DistributionConfigProperty value)
The current configuration information for the distribution.
|
void |
setDistributionConfig(IResolvable value)
The current configuration information for the distribution.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdgetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnDistribution(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnDistribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnDistribution(@NotNull
Construct scope,
@NotNull
String id,
@NotNull
CfnDistributionProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrDomainName()
@Stability(value=Stable) @NotNull public String getAttrId()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
@Stability(value=Stable) @NotNull public Object getDistributionConfig()
Send a GET request to the / *CloudFront API version* /distribution ID/config resource.
@Stability(value=Stable)
public void setDistributionConfig(@NotNull
IResolvable value)
Send a GET request to the / *CloudFront API version* /distribution ID/config resource.
@Stability(value=Stable)
public void setDistributionConfig(@NotNull
CfnDistribution.DistributionConfigProperty value)
Send a GET request to the / *CloudFront API version* /distribution ID/config resource.
Copyright © 2022. All rights reserved.