Class CfnDistribution
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::Lightsail::Distribution
.
The AWS::Lightsail::Distribution
resource specifies a content delivery network (CDN) distribution. You can create distributions only in the us-east-1
AWS Region.
A distribution is a globally distributed network of caching servers that improve the performance of your website or web application hosted on a Lightsail instance, static content hosted on a Lightsail bucket, or through a Lightsail load balancer.
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.lightsail.*; CfnDistribution cfnDistribution = CfnDistribution.Builder.create(this, "MyCfnDistribution") .bundleId("bundleId") .defaultCacheBehavior(CacheBehaviorProperty.builder() .behavior("behavior") .build()) .distributionName("distributionName") .origin(InputOriginProperty.builder() .name("name") .protocolPolicy("protocolPolicy") .regionName("regionName") .build()) // the properties below are optional .cacheBehaviors(List.of(CacheBehaviorPerPathProperty.builder() .behavior("behavior") .path("path") .build())) .cacheBehaviorSettings(CacheSettingsProperty.builder() .allowedHttpMethods("allowedHttpMethods") .cachedHttpMethods("cachedHttpMethods") .defaultTtl(123) .forwardedCookies(CookieObjectProperty.builder() .cookiesAllowList(List.of("cookiesAllowList")) .option("option") .build()) .forwardedHeaders(HeaderObjectProperty.builder() .headersAllowList(List.of("headersAllowList")) .option("option") .build()) .forwardedQueryStrings(QueryStringObjectProperty.builder() .option(false) .queryStringsAllowList(List.of("queryStringsAllowList")) .build()) .maximumTtl(123) .minimumTtl(123) .build()) .certificateName("certificateName") .ipAddressType("ipAddressType") .isEnabled(false) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnDistribution
.static interface
CacheBehaviorPerPath
is a property of the AWS::Lightsail::Distribution resource.static interface
CacheBehavior
is a property of the AWS::Lightsail::Distribution resource.static interface
CacheSettings
is a property of the AWS::Lightsail::Distribution resource.static interface
CookieObject
is a property of the CacheSettings property.static interface
HeaderObject
is a property of the CacheSettings property.static interface
InputOrigin
is a property of the AWS::Lightsail::Distribution resource.static interface
QueryStringObject
is a property of the CacheSettings property.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionCfnDistribution
(Construct scope, String id, CfnDistributionProps props) Create a newAWS::Lightsail::Distribution
.protected
CfnDistribution
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnDistribution
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionIndicates whether you can update the distribution’s current bundle to another bundle.The Amazon Resource Name (ARN) of the distribution.The status of the distribution.The ID of the bundle applied to the distribution.An array of objects that describe the per-path cache behavior of the distribution.An object that describes the cache behavior settings of the distribution.The name of the SSL/TLS certificate attached to the distribution.An object that describes the default cache behavior of the distribution.The name of the distribution.The IP address type of the distribution.A Boolean value indicating whether the distribution is enabled.An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.getTags()
An array of key-value pairs to apply to this resource.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setBundleId
(String value) The ID of the bundle applied to the distribution.void
setCacheBehaviors
(List<Object> value) An array of objects that describe the per-path cache behavior of the distribution.void
setCacheBehaviors
(IResolvable value) An array of objects that describe the per-path cache behavior of the distribution.void
An object that describes the cache behavior settings of the distribution.void
An object that describes the cache behavior settings of the distribution.void
setCertificateName
(String value) The name of the SSL/TLS certificate attached to the distribution.void
An object that describes the default cache behavior of the distribution.void
An object that describes the default cache behavior of the distribution.void
setDistributionName
(String value) The name of the distribution.void
setIpAddressType
(String value) The IP address type of the distribution.void
setIsEnabled
(Boolean value) A Boolean value indicating whether the distribution is enabled.void
setIsEnabled
(IResolvable value) A Boolean value indicating whether the distribution is enabled.void
setOrigin
(IResolvable value) An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.void
An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnDistribution
protected CfnDistribution(software.amazon.jsii.JsiiObjectRef objRef) -
CfnDistribution
protected CfnDistribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnDistribution
@Stability(Stable) public CfnDistribution(@NotNull Construct scope, @NotNull String id, @NotNull CfnDistributionProps props) Create a newAWS::Lightsail::Distribution
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrAbleToUpdateBundle
Indicates whether you can update the distribution’s current bundle to another bundle. -
getAttrDistributionArn
The Amazon Resource Name (ARN) of the distribution. -
getAttrStatus
The status of the distribution. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
An array of key-value pairs to apply to this resource.For more information, see Tag in the AWS CloudFormation User Guide .
The
Value
ofTags
is optional for Lightsail resources. -
getBundleId
The ID of the bundle applied to the distribution. -
setBundleId
The ID of the bundle applied to the distribution. -
getDefaultCacheBehavior
An object that describes the default cache behavior of the distribution. -
setDefaultCacheBehavior
An object that describes the default cache behavior of the distribution. -
setDefaultCacheBehavior
@Stability(Stable) public void setDefaultCacheBehavior(@NotNull CfnDistribution.CacheBehaviorProperty value) An object that describes the default cache behavior of the distribution. -
getDistributionName
The name of the distribution. -
setDistributionName
The name of the distribution. -
getOrigin
An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.The distribution pulls, caches, and serves content from the origin.
-
setOrigin
An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.The distribution pulls, caches, and serves content from the origin.
-
setOrigin
An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.The distribution pulls, caches, and serves content from the origin.
-
getCacheBehaviors
An array of objects that describe the per-path cache behavior of the distribution. -
setCacheBehaviors
An array of objects that describe the per-path cache behavior of the distribution. -
setCacheBehaviors
An array of objects that describe the per-path cache behavior of the distribution. -
getCacheBehaviorSettings
An object that describes the cache behavior settings of the distribution. -
setCacheBehaviorSettings
An object that describes the cache behavior settings of the distribution. -
setCacheBehaviorSettings
@Stability(Stable) public void setCacheBehaviorSettings(@Nullable CfnDistribution.CacheSettingsProperty value) An object that describes the cache behavior settings of the distribution. -
getCertificateName
The name of the SSL/TLS certificate attached to the distribution. -
setCertificateName
The name of the SSL/TLS certificate attached to the distribution. -
getIpAddressType
The IP address type of the distribution.The possible values are
ipv4
for IPv4 only, anddualstack
for IPv4 and IPv6. -
setIpAddressType
The IP address type of the distribution.The possible values are
ipv4
for IPv4 only, anddualstack
for IPv4 and IPv6. -
getIsEnabled
A Boolean value indicating whether the distribution is enabled. -
setIsEnabled
A Boolean value indicating whether the distribution is enabled. -
setIsEnabled
A Boolean value indicating whether the distribution is enabled.
-