Class CfnDistribution
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.lightsail.CfnDistribution
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,IDistributionRef,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:39.731Z")
@Stability(Stable)
public class CfnDistribution
extends CfnResource
implements IInspectable, IDistributionRef, ITaggable
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();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnDistribution.static interfaceCacheBehaviorPerPathis a property of the AWS::Lightsail::Distribution resource.static interfaceCacheBehavioris a property of the AWS::Lightsail::Distribution resource.static interfaceCacheSettingsis a property of the AWS::Lightsail::Distribution resource.static interfaceCookieObjectis a property of the CacheSettings property.static interfaceHeaderObjectis a property of the CacheSettings property.static interfaceInputOriginis a property of the AWS::Lightsail::Distribution resource.static interfaceQueryStringObjectis a property of the CacheSettings property.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.lightsail.IDistributionRef
IDistributionRef.Jsii$Default, IDistributionRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnDistribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnDistribution(software.amazon.jsii.JsiiObjectRef objRef) CfnDistribution(software.constructs.Construct scope, String id, CfnDistributionProps props) Create a newAWS::Lightsail::Distribution. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForDistribution(IDistributionRef resource) Indicates 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.A reference to a Distribution resource.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()Tag Manager which manages the tags for this resource.An array of key-value pairs to apply to this resource.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnDistribution.renderProperties(Map<String, Object> props) voidsetBundleId(String value) The ID of the bundle applied to the distribution.voidsetCacheBehaviors(List<Object> value) An array of objects that describe the per-path cache behavior of the distribution.voidsetCacheBehaviors(IResolvable value) An array of objects that describe the per-path cache behavior of the distribution.voidAn object that describes the cache behavior settings of the distribution.voidAn object that describes the cache behavior settings of the distribution.voidsetCertificateName(String value) The name of the SSL/TLS certificate attached to the distribution.voidAn object that describes the default cache behavior of the distribution.voidAn object that describes the default cache behavior of the distribution.voidsetDistributionName(String value) The name of the distribution.voidsetIpAddressType(String value) The IP address type of the distribution.voidsetIsEnabled(Boolean value) A Boolean value indicating whether the distribution is enabled.voidsetIsEnabled(IResolvable value) A Boolean value indicating whether the distribution is enabled.voidsetOrigin(IResolvable value) An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.voidAn object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.voidsetTagsRaw(List<CfnTag> value) An array of key-value pairs to apply to this resource.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnDistributionProps props) Create a newAWS::Lightsail::Distribution.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForDistribution
@Stability(Stable) @NotNull public static String arnForDistribution(@NotNull IDistributionRef resource) - Parameters:
resource- This parameter is required.
-
isCfnDistribution
Checks whether the given object is a CfnDistribution.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin 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:
getCfnPropertiesin classCfnResource
-
getDistributionRef
A reference to a Distribution resource.- Specified by:
getDistributionRefin interfaceIDistributionRef
-
getTags
Tag Manager which manages the tags for this resource. -
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.Returns union: either
IResolvableorCfnDistribution.CacheBehaviorProperty -
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.Returns union: either
IResolvableorCfnDistribution.InputOriginProperty -
setOrigin
An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. -
setOrigin
An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. -
getCacheBehaviors
An array of objects that describe the per-path cache behavior of the distribution.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnDistribution.CacheBehaviorPerPathProperty> -
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.Returns union: either
IResolvableorCfnDistribution.CacheSettingsProperty -
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. -
setIpAddressType
The IP address type of the distribution. -
getIsEnabled
A Boolean value indicating whether the distribution is enabled.Returns union: either
BooleanorIResolvable -
setIsEnabled
A Boolean value indicating whether the distribution is enabled. -
setIsEnabled
A Boolean value indicating whether the distribution is enabled. -
getTagsRaw
An array of key-value pairs to apply to this resource. -
setTagsRaw
An array of key-value pairs to apply to this resource.
-