AWS::CloudFront::Distribution
Creates an Amazon CloudFront web distribution. For general information about CloudFront distributions, see the Introduction to Amazon CloudFront in the Amazon CloudFront Developer Guide. For specific information about creating CloudFront web distributions, see CreateDistribution in the Amazon CloudFront API Reference.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::CloudFront::Distribution", "Properties" : { "DistributionConfig" : DistributionConfig, "Tags" : [ Tag, ... ] } }
YAML
Type: AWS::CloudFront::Distribution Properties: DistributionConfig: DistributionConfig Tags: - Tag
Properties
DistributionConfig-
The distribution's configuration information.
Required: Yes
Type: DistributionConfig type
Update requires: No interruption
Tags-
An arbitrary set of tags (key–value pairs) to associate with a CloudFront distribution.
Required: No
Type: List of Resource Tag
Update requires: No interruption
Duplicates not allowed.
Return Values
Ref
Returns: The CloudFront
distribution ID. For example: E27LVI50CSW06W.
For more information about using the Ref function, see Ref.
Fn::GetAtt
Fn::GetAtt returns a value for a specified attribute of this type.
The following are the available attributes and sample return values.
DomainName-
Returns: The domain name of the resource. For example:
d2fadu0nynjpfn.cloudfront.net.
For more information about using Fn::GetAtt, see Fn::GetAtt.
Example
The following example specifies a distribution and assigns it a single tag.
JSON
{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "cloudfrontdistribution": { "Type": "AWS::CloudFront::Distribution", "Properties": { "DistributionConfig": { "CacheBehaviors": [ { "LambdaFunctionAssociations": [ { "EventType": "string-value", "LambdaFunctionARN": "string-value" } ] } ], "DefaultCacheBehavior": { "LambdaFunctionAssociations": [ { "EventType": "string-value", "LambdaFunctionARN": "string-value" } ] }, "IPV6Enabled": "boolean-value", "Origins": [ { "CustomOriginConfig": { "OriginKeepaliveTimeout": "integer-value", "OriginReadTimeout": "integer-value" } } ] }, "Tags": [ { "Key": "string-value", "Value": "string-value" } ] } } } }
YAML
AWSTemplateFormatVersion: 2010-09-09 Resources: cloudfrontdistribution: Type: AWS::CloudFront::Distribution Properties: DistributionConfig: CacheBehaviors: - LambdaFunctionAssociations: - EventType: string-value LambdaFunctionARN: string-value DefaultCacheBehavior: LambdaFunctionAssociations: - EventType: string-value LambdaFunctionARN: string-value IPV6Enabled: boolean-value Origins: - CustomOriginConfig: OriginKeepaliveTimeout: integer-value OriginReadTimeout: integer-value Tags: - Key: string-value Value: string-value
See Also
-
CreateDistribution in the Amazon CloudFront API Reference
