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
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.
Syntax
To declare this entity in your Amazon CloudFormation template, use the following syntax:
JSON
{ "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, ... ]} }
YAML
Type: AWS::Lightsail::Distribution Properties: BundleId:StringCacheBehaviors:- CacheBehaviorPerPathCacheBehaviorSettings:CacheSettingsCertificateName:StringDefaultCacheBehavior:CacheBehaviorDistributionName:StringIpAddressType:StringIsEnabled:BooleanOrigin:InputOriginTags:- Tag
Properties
BundleId-
The ID of the bundle applied to the distribution.
Required: Yes
Type: String
Update requires: No interruption
CacheBehaviors-
An array of objects that describe the per-path cache behavior of the distribution.
Required: No
Type: List of CacheBehaviorPerPath
Update requires: No interruption
CacheBehaviorSettings-
An object that describes the cache behavior settings of the distribution.
Required: No
Type: CacheSettings
Update requires: No interruption
CertificateName-
The name of the SSL/TLS certificate attached to the distribution.
Required: No
Type: String
Pattern:
\w[\w\-]*\wUpdate requires: No interruption
DefaultCacheBehavior-
An object that describes the default cache behavior of the distribution.
Required: Yes
Type: CacheBehavior
Update requires: No interruption
DistributionName-
The name of the distribution
Required: Yes
Type: String
Update requires: Replacement
IpAddressType-
The IP address type of the distribution.
The possible values are
ipv4for IPv4 only, anddualstackfor IPv4 and IPv6.Required: No
Type: String
Allowed values:
dualstack | ipv4Update requires: Updates are not supported.
IsEnabled-
A Boolean value indicating whether the distribution is enabled.
Required: No
Type: Boolean
Update requires: No interruption
Origin-
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
Tags-
An array of key-value pairs to apply to this resource.
For more information, see Tag in the Amazon CloudFormation User Guide.
Note
The
ValueofTagsis optional for Lightsail resources.Required: No
Type: List of Tag
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Reffunction, Refreturns a unique identifier for this resource.
Fn::GetAtt
The Fn::GetAttintrinsic 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::GetAttintrinsic function, see Fn::GetAtt.
Remarks
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.