AWS::Lightsail::Distribution - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


The AWS::Lightsail::Distribution resource specifies a content delivery network (CDN) distribution. You can create distributions only in the us-east-1 Amazon 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.


To declare this entity in your Amazon CloudFormation template, use the following syntax:


{ "Type" : "AWS::Lightsail::Distribution", "Properties" : { "BundleId" : String, "CacheBehaviors" : [ CacheBehaviorPerPath, ... ], "CacheBehaviorSettings" : CacheSettings, "CertificateName" : String, "DefaultCacheBehavior" : CacheBehavior, "DistributionName" : String, "IpAddressType" : String, "IsEnabled" : Boolean, "Origin" : InputOrigin, "Tags" : [ Tag, ... ] } }



The ID of the bundle applied to the distribution.

Required: Yes

Type: String

Update requires: No interruption


An array of objects that describe the per-path cache behavior of the distribution.

Required: No

Type: Array of CacheBehaviorPerPath

Update requires: No interruption


An object that describes the cache behavior settings of the distribution.

Required: No

Type: CacheSettings

Update requires: No interruption


The name of the SSL/TLS certificate attached to the distribution.

Required: No

Type: String

Pattern: \w[\w\-]*\w

Update requires: No interruption


An object that describes the default cache behavior of the distribution.

Required: Yes

Type: CacheBehavior

Update requires: No interruption


The name of the distribution

Required: Yes

Type: String

Pattern: \w[\w\-]*\w

Update requires: Replacement


The IP address type of the distribution.

The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6.

Required: No

Type: String

Allowed values: dualstack | ipv4 | ipv6

Update requires: Updates are not supported.


A Boolean value indicating whether the distribution is enabled.

Required: No

Type: Boolean

Update requires: No interruption


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.

Required: Yes

Type: InputOrigin

Update requires: No interruption


An array of key-value pairs to apply to this resource.

For more information, see Tag in the Amazon CloudFormation User Guide.


The Value of Tags is optional for Lightsail resources.

Required: No

Type: Array of Tag

Update requires: No interruption

Return values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns a unique identifier for this resource.


The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.


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.


Configuring cache behavior settings

The CacheBehaviorSettings parameter can be set only if the DefaultCacheBehavior parameter is set to cache, or if the CacheBehaviors parameter has a path with a cache behavior. If neither of those conditions are true, the CacheBehaviorSettings will not be set for the distribution and the stack will drift.