Distribution
Creates an Amazon CloudFront web distribution.
For information about CloudFront distributions, see the Amazon CloudFront Developer Guide. For specific information about creating CloudFront web distributions, see the POST Distribution page in the Amazon CloudFront API Reference.
NOTE: CloudFront distributions take about 15 minutes to a deployed state after creation or modification. During this time, deletes to resources will be blocked. If you need to delete a distribution that is enabled and you do not want to wait, you need to use the
retain_on_deleteflag.
Create a Distribution Resource
new Distribution(name: string, args: DistributionArgs, opts?: CustomResourceOptions);def Distribution(resource_name, opts=None, aliases=None, comment=None, custom_error_responses=None, default_cache_behavior=None, default_root_object=None, enabled=None, http_version=None, is_ipv6_enabled=None, logging_config=None, ordered_cache_behaviors=None, origin_groups=None, origins=None, price_class=None, restrictions=None, retain_on_delete=None, tags=None, viewer_certificate=None, wait_for_deployment=None, web_acl_id=None, __props__=None);func NewDistribution(ctx *Context, name string, args DistributionArgs, opts ...ResourceOption) (*Distribution, error)public Distribution(string name, DistributionArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args DistributionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DistributionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DistributionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Distribution Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Distribution resource accepts the following input properties:
- Default
Cache DistributionBehavior Default Cache Behavior Args The default cache behavior for this distribution (maximum one).
- Enabled bool
Whether the distribution is enabled to accept end user requests for content.
- Origins
List<Distribution
Origin Args> One or more origins for this distribution (multiples allowed).
- Restrictions
Distribution
Restrictions Args The restriction configuration for this distribution (maximum one).
- Viewer
Certificate DistributionViewer Certificate Args The SSL configuration for this distribution (maximum one).
- Aliases List<string>
Extra CNAMEs (alternate domain names), if any, for this distribution.
- Comment string
Any comments you want to include about the distribution.
- Custom
Error List<DistributionResponses Custom Error Response Args> One or more custom error response elements (multiples allowed).
- Default
Root stringObject The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
- Http
Version string The maximum HTTP version to support on the distribution. Allowed values are
http1.1andhttp2. The default ishttp2.- Is
Ipv6Enabled bool Whether the IPv6 is enabled for the distribution.
- Logging
Config DistributionLogging Config Args The logging configuration that controls how logs are written to your distribution (maximum one).
- Ordered
Cache List<DistributionBehaviors Ordered Cache Behavior Args> An ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
- Origin
Groups List<DistributionOrigin Group Args> One or more origin_group for this distribution (multiples allowed).
- Price
Class string The price class for this distribution. One of
PriceClass_All,PriceClass_200,PriceClass_100- Retain
On boolDelete Disables the distribution instead of deleting it when destroying the resource. If this is set, the distribution needs to be deleted manually afterwards. Default:
false.- Dictionary<string, string>
A map of tags to assign to the resource.
- Wait
For boolDeployment If enabled, the resource will wait for the distribution status to change from
InProgresstoDeployed. Setting this tofalsewill skip the process. Default:true.- Web
Acl stringId If you’re using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have
waf:GetWebACLpermissions assigned. If using WAFv2, provide the ARN of the web ACL.
- Default
Cache DistributionBehavior Default Cache Behavior The default cache behavior for this distribution (maximum one).
- Enabled bool
Whether the distribution is enabled to accept end user requests for content.
- Origins
[]Distribution
Origin One or more origins for this distribution (multiples allowed).
- Restrictions
Distribution
Restrictions The restriction configuration for this distribution (maximum one).
- Viewer
Certificate DistributionViewer Certificate The SSL configuration for this distribution (maximum one).
- Aliases []string
Extra CNAMEs (alternate domain names), if any, for this distribution.
- Comment string
Any comments you want to include about the distribution.
- Custom
Error []DistributionResponses Custom Error Response One or more custom error response elements (multiples allowed).
- Default
Root stringObject The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
- Http
Version string The maximum HTTP version to support on the distribution. Allowed values are
http1.1andhttp2. The default ishttp2.- Is
Ipv6Enabled bool Whether the IPv6 is enabled for the distribution.
- Logging
Config DistributionLogging Config The logging configuration that controls how logs are written to your distribution (maximum one).
- Ordered
Cache []DistributionBehaviors Ordered Cache Behavior An ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
- Origin
Groups []DistributionOrigin Group One or more origin_group for this distribution (multiples allowed).
- Price
Class string The price class for this distribution. One of
PriceClass_All,PriceClass_200,PriceClass_100- Retain
On boolDelete Disables the distribution instead of deleting it when destroying the resource. If this is set, the distribution needs to be deleted manually afterwards. Default:
false.- map[string]string
A map of tags to assign to the resource.
- Wait
For boolDeployment If enabled, the resource will wait for the distribution status to change from
InProgresstoDeployed. Setting this tofalsewill skip the process. Default:true.- Web
Acl stringId If you’re using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have
waf:GetWebACLpermissions assigned. If using WAFv2, provide the ARN of the web ACL.
- default
Cache DistributionBehavior Default Cache Behavior The default cache behavior for this distribution (maximum one).
- enabled boolean
Whether the distribution is enabled to accept end user requests for content.
- origins
Distribution
Origin[] One or more origins for this distribution (multiples allowed).
- restrictions
Distribution
Restrictions The restriction configuration for this distribution (maximum one).
- viewer
Certificate DistributionViewer Certificate The SSL configuration for this distribution (maximum one).
- aliases string[]
Extra CNAMEs (alternate domain names), if any, for this distribution.
- comment string
Any comments you want to include about the distribution.
- custom
Error DistributionResponses Custom Error Response[] One or more custom error response elements (multiples allowed).
- default
Root stringObject The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
- http
Version string The maximum HTTP version to support on the distribution. Allowed values are
http1.1andhttp2. The default ishttp2.- is
Ipv6Enabled boolean Whether the IPv6 is enabled for the distribution.
- logging
Config DistributionLogging Config The logging configuration that controls how logs are written to your distribution (maximum one).
- ordered
Cache DistributionBehaviors Ordered Cache Behavior[] An ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
- origin
Groups DistributionOrigin Group[] One or more origin_group for this distribution (multiples allowed).
- price
Class string The price class for this distribution. One of
PriceClass_All,PriceClass_200,PriceClass_100- retain
On booleanDelete Disables the distribution instead of deleting it when destroying the resource. If this is set, the distribution needs to be deleted manually afterwards. Default:
false.- {[key: string]: string}
A map of tags to assign to the resource.
- wait
For booleanDeployment If enabled, the resource will wait for the distribution status to change from
InProgresstoDeployed. Setting this tofalsewill skip the process. Default:true.- web
Acl stringId If you’re using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have
waf:GetWebACLpermissions assigned. If using WAFv2, provide the ARN of the web ACL.
- default_
cache_ Dict[Distributionbehavior Default Cache Behavior] The default cache behavior for this distribution (maximum one).
- enabled bool
Whether the distribution is enabled to accept end user requests for content.
- origins
List[Distribution
Origin] One or more origins for this distribution (multiples allowed).
- restrictions
Dict[Distribution
Restrictions] The restriction configuration for this distribution (maximum one).
- viewer_
certificate Dict[DistributionViewer Certificate] The SSL configuration for this distribution (maximum one).
- aliases List[str]
Extra CNAMEs (alternate domain names), if any, for this distribution.
- comment str
Any comments you want to include about the distribution.
- custom_
error_ List[Distributionresponses Custom Error Response] One or more custom error response elements (multiples allowed).
- default_
root_ strobject The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
- http_
version str The maximum HTTP version to support on the distribution. Allowed values are
http1.1andhttp2. The default ishttp2.- is_
ipv6_ boolenabled Whether the IPv6 is enabled for the distribution.
- logging_
config Dict[DistributionLogging Config] The logging configuration that controls how logs are written to your distribution (maximum one).
- ordered_
cache_ List[Distributionbehaviors Ordered Cache Behavior] An ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
- origin_
groups List[DistributionOrigin Group] One or more origin_group for this distribution (multiples allowed).
- price_
class str The price class for this distribution. One of
PriceClass_All,PriceClass_200,PriceClass_100- retain_
on_ booldelete Disables the distribution instead of deleting it when destroying the resource. If this is set, the distribution needs to be deleted manually afterwards. Default:
false.- Dict[str, str]
A map of tags to assign to the resource.
- wait_
for_ booldeployment If enabled, the resource will wait for the distribution status to change from
InProgresstoDeployed. Setting this tofalsewill skip the process. Default:true.- web_
acl_ strid If you’re using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have
waf:GetWebACLpermissions assigned. If using WAFv2, provide the ARN of the web ACL.
Outputs
All input properties are implicitly available as output properties. Additionally, the Distribution resource produces the following output properties:
- Active
Trusted Dictionary<string, string>Signers The key pair IDs that CloudFront is aware of for each trusted signer, if the distribution is set up to serve private content with signed URLs.
- Arn string
The ARN (Amazon Resource Name) for the distribution. For example:
arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where123456789012is your AWS account ID.- Caller
Reference string Internal value used by CloudFront to allow future updates to the distribution configuration.
- Domain
Name string The DNS domain name of either the S3 bucket, or web site of your custom origin.
- Etag string
The current version of the distribution’s information. For example:
E2QWRUHAPOMQZL.- Hosted
Zone stringId The CloudFront Route 53 zone ID that can be used to route an Alias Resource Record Set to. This attribute is simply an alias for the zone ID
Z2FDTNDATAQYW2.- Id string
- The provider-assigned unique ID for this managed resource.
- In
Progress intValidation Batches The number of invalidation batches currently in progress.
- Last
Modified stringTime The date and time the distribution was last modified.
- Status string
The current status of the distribution.
Deployedif the distribution’s information is fully propagated throughout the Amazon CloudFront system.
- Active
Trusted map[string]stringSigners The key pair IDs that CloudFront is aware of for each trusted signer, if the distribution is set up to serve private content with signed URLs.
- Arn string
The ARN (Amazon Resource Name) for the distribution. For example:
arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where123456789012is your AWS account ID.- Caller
Reference string Internal value used by CloudFront to allow future updates to the distribution configuration.
- Domain
Name string The DNS domain name of either the S3 bucket, or web site of your custom origin.
- Etag string
The current version of the distribution’s information. For example:
E2QWRUHAPOMQZL.- Hosted
Zone stringId The CloudFront Route 53 zone ID that can be used to route an Alias Resource Record Set to. This attribute is simply an alias for the zone ID
Z2FDTNDATAQYW2.- Id string
- The provider-assigned unique ID for this managed resource.
- In
Progress intValidation Batches The number of invalidation batches currently in progress.
- Last
Modified stringTime The date and time the distribution was last modified.
- Status string
The current status of the distribution.
Deployedif the distribution’s information is fully propagated throughout the Amazon CloudFront system.
- active
Trusted {[key: string]: string}Signers The key pair IDs that CloudFront is aware of for each trusted signer, if the distribution is set up to serve private content with signed URLs.
- arn string
The ARN (Amazon Resource Name) for the distribution. For example:
arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where123456789012is your AWS account ID.- caller
Reference string Internal value used by CloudFront to allow future updates to the distribution configuration.
- domain
Name string The DNS domain name of either the S3 bucket, or web site of your custom origin.
- etag string
The current version of the distribution’s information. For example:
E2QWRUHAPOMQZL.- hosted
Zone stringId The CloudFront Route 53 zone ID that can be used to route an Alias Resource Record Set to. This attribute is simply an alias for the zone ID
Z2FDTNDATAQYW2.- id string
- The provider-assigned unique ID for this managed resource.
- in
Progress numberValidation Batches The number of invalidation batches currently in progress.
- last
Modified stringTime The date and time the distribution was last modified.
- status string
The current status of the distribution.
Deployedif the distribution’s information is fully propagated throughout the Amazon CloudFront system.
- active_
trusted_ Dict[str, str]signers The key pair IDs that CloudFront is aware of for each trusted signer, if the distribution is set up to serve private content with signed URLs.
- arn str
The ARN (Amazon Resource Name) for the distribution. For example:
arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where123456789012is your AWS account ID.- caller_
reference str Internal value used by CloudFront to allow future updates to the distribution configuration.
- domain_
name str The DNS domain name of either the S3 bucket, or web site of your custom origin.
- etag str
The current version of the distribution’s information. For example:
E2QWRUHAPOMQZL.- hosted_
zone_ strid The CloudFront Route 53 zone ID that can be used to route an Alias Resource Record Set to. This attribute is simply an alias for the zone ID
Z2FDTNDATAQYW2.- id str
- The provider-assigned unique ID for this managed resource.
- in_
progress_ floatvalidation_ batches The number of invalidation batches currently in progress.
- last_
modified_ strtime The date and time the distribution was last modified.
- status str
The current status of the distribution.
Deployedif the distribution’s information is fully propagated throughout the Amazon CloudFront system.
Look up an Existing Distribution Resource
Get an existing Distribution resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DistributionState, opts?: CustomResourceOptions): Distributionstatic get(resource_name, id, opts=None, active_trusted_signers=None, aliases=None, arn=None, caller_reference=None, comment=None, custom_error_responses=None, default_cache_behavior=None, default_root_object=None, domain_name=None, enabled=None, etag=None, hosted_zone_id=None, http_version=None, in_progress_validation_batches=None, is_ipv6_enabled=None, last_modified_time=None, logging_config=None, ordered_cache_behaviors=None, origin_groups=None, origins=None, price_class=None, restrictions=None, retain_on_delete=None, status=None, tags=None, viewer_certificate=None, wait_for_deployment=None, web_acl_id=None, __props__=None);func GetDistribution(ctx *Context, name string, id IDInput, state *DistributionState, opts ...ResourceOption) (*Distribution, error)public static Distribution Get(string name, Input<string> id, DistributionState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Active
Trusted Dictionary<string, string>Signers The key pair IDs that CloudFront is aware of for each trusted signer, if the distribution is set up to serve private content with signed URLs.
- Aliases List<string>
Extra CNAMEs (alternate domain names), if any, for this distribution.
- Arn string
The ARN (Amazon Resource Name) for the distribution. For example:
arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where123456789012is your AWS account ID.- Caller
Reference string Internal value used by CloudFront to allow future updates to the distribution configuration.
- Comment string
Any comments you want to include about the distribution.
- Custom
Error List<DistributionResponses Custom Error Response Args> One or more custom error response elements (multiples allowed).
- Default
Cache DistributionBehavior Default Cache Behavior Args The default cache behavior for this distribution (maximum one).
- Default
Root stringObject The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
- Domain
Name string The DNS domain name of either the S3 bucket, or web site of your custom origin.
- Enabled bool
Whether the distribution is enabled to accept end user requests for content.
- Etag string
The current version of the distribution’s information. For example:
E2QWRUHAPOMQZL.- Hosted
Zone stringId The CloudFront Route 53 zone ID that can be used to route an Alias Resource Record Set to. This attribute is simply an alias for the zone ID
Z2FDTNDATAQYW2.- Http
Version string The maximum HTTP version to support on the distribution. Allowed values are
http1.1andhttp2. The default ishttp2.- In
Progress intValidation Batches The number of invalidation batches currently in progress.
- Is
Ipv6Enabled bool Whether the IPv6 is enabled for the distribution.
- Last
Modified stringTime The date and time the distribution was last modified.
- Logging
Config DistributionLogging Config Args The logging configuration that controls how logs are written to your distribution (maximum one).
- Ordered
Cache List<DistributionBehaviors Ordered Cache Behavior Args> An ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
- Origin
Groups List<DistributionOrigin Group Args> One or more origin_group for this distribution (multiples allowed).
- Origins
List<Distribution
Origin Args> One or more origins for this distribution (multiples allowed).
- Price
Class string The price class for this distribution. One of
PriceClass_All,PriceClass_200,PriceClass_100- Restrictions
Distribution
Restrictions Args The restriction configuration for this distribution (maximum one).
- Retain
On boolDelete Disables the distribution instead of deleting it when destroying the resource. If this is set, the distribution needs to be deleted manually afterwards. Default:
false.- Status string
The current status of the distribution.
Deployedif the distribution’s information is fully propagated throughout the Amazon CloudFront system.- Dictionary<string, string>
A map of tags to assign to the resource.
- Viewer
Certificate DistributionViewer Certificate Args The SSL configuration for this distribution (maximum one).
- Wait
For boolDeployment If enabled, the resource will wait for the distribution status to change from
InProgresstoDeployed. Setting this tofalsewill skip the process. Default:true.- Web
Acl stringId If you’re using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have
waf:GetWebACLpermissions assigned. If using WAFv2, provide the ARN of the web ACL.
- Active
Trusted map[string]stringSigners The key pair IDs that CloudFront is aware of for each trusted signer, if the distribution is set up to serve private content with signed URLs.
- Aliases []string
Extra CNAMEs (alternate domain names), if any, for this distribution.
- Arn string
The ARN (Amazon Resource Name) for the distribution. For example:
arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where123456789012is your AWS account ID.- Caller
Reference string Internal value used by CloudFront to allow future updates to the distribution configuration.
- Comment string
Any comments you want to include about the distribution.
- Custom
Error []DistributionResponses Custom Error Response One or more custom error response elements (multiples allowed).
- Default
Cache DistributionBehavior Default Cache Behavior The default cache behavior for this distribution (maximum one).
- Default
Root stringObject The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
- Domain
Name string The DNS domain name of either the S3 bucket, or web site of your custom origin.
- Enabled bool
Whether the distribution is enabled to accept end user requests for content.
- Etag string
The current version of the distribution’s information. For example:
E2QWRUHAPOMQZL.- Hosted
Zone stringId The CloudFront Route 53 zone ID that can be used to route an Alias Resource Record Set to. This attribute is simply an alias for the zone ID
Z2FDTNDATAQYW2.- Http
Version string The maximum HTTP version to support on the distribution. Allowed values are
http1.1andhttp2. The default ishttp2.- In
Progress intValidation Batches The number of invalidation batches currently in progress.
- Is
Ipv6Enabled bool Whether the IPv6 is enabled for the distribution.
- Last
Modified stringTime The date and time the distribution was last modified.
- Logging
Config DistributionLogging Config The logging configuration that controls how logs are written to your distribution (maximum one).
- Ordered
Cache []DistributionBehaviors Ordered Cache Behavior An ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
- Origin
Groups []DistributionOrigin Group One or more origin_group for this distribution (multiples allowed).
- Origins
[]Distribution
Origin One or more origins for this distribution (multiples allowed).
- Price
Class string The price class for this distribution. One of
PriceClass_All,PriceClass_200,PriceClass_100- Restrictions
Distribution
Restrictions The restriction configuration for this distribution (maximum one).
- Retain
On boolDelete Disables the distribution instead of deleting it when destroying the resource. If this is set, the distribution needs to be deleted manually afterwards. Default:
false.- Status string
The current status of the distribution.
Deployedif the distribution’s information is fully propagated throughout the Amazon CloudFront system.- map[string]string
A map of tags to assign to the resource.
- Viewer
Certificate DistributionViewer Certificate The SSL configuration for this distribution (maximum one).
- Wait
For boolDeployment If enabled, the resource will wait for the distribution status to change from
InProgresstoDeployed. Setting this tofalsewill skip the process. Default:true.- Web
Acl stringId If you’re using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have
waf:GetWebACLpermissions assigned. If using WAFv2, provide the ARN of the web ACL.
- active
Trusted {[key: string]: string}Signers The key pair IDs that CloudFront is aware of for each trusted signer, if the distribution is set up to serve private content with signed URLs.
- aliases string[]
Extra CNAMEs (alternate domain names), if any, for this distribution.
- arn string
The ARN (Amazon Resource Name) for the distribution. For example:
arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where123456789012is your AWS account ID.- caller
Reference string Internal value used by CloudFront to allow future updates to the distribution configuration.
- comment string
Any comments you want to include about the distribution.
- custom
Error DistributionResponses Custom Error Response[] One or more custom error response elements (multiples allowed).
- default
Cache DistributionBehavior Default Cache Behavior The default cache behavior for this distribution (maximum one).
- default
Root stringObject The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
- domain
Name string The DNS domain name of either the S3 bucket, or web site of your custom origin.
- enabled boolean
Whether the distribution is enabled to accept end user requests for content.
- etag string
The current version of the distribution’s information. For example:
E2QWRUHAPOMQZL.- hosted
Zone stringId The CloudFront Route 53 zone ID that can be used to route an Alias Resource Record Set to. This attribute is simply an alias for the zone ID
Z2FDTNDATAQYW2.- http
Version string The maximum HTTP version to support on the distribution. Allowed values are
http1.1andhttp2. The default ishttp2.- in
Progress numberValidation Batches The number of invalidation batches currently in progress.
- is
Ipv6Enabled boolean Whether the IPv6 is enabled for the distribution.
- last
Modified stringTime The date and time the distribution was last modified.
- logging
Config DistributionLogging Config The logging configuration that controls how logs are written to your distribution (maximum one).
- ordered
Cache DistributionBehaviors Ordered Cache Behavior[] An ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
- origin
Groups DistributionOrigin Group[] One or more origin_group for this distribution (multiples allowed).
- origins
Distribution
Origin[] One or more origins for this distribution (multiples allowed).
- price
Class string The price class for this distribution. One of
PriceClass_All,PriceClass_200,PriceClass_100- restrictions
Distribution
Restrictions The restriction configuration for this distribution (maximum one).
- retain
On booleanDelete Disables the distribution instead of deleting it when destroying the resource. If this is set, the distribution needs to be deleted manually afterwards. Default:
false.- status string
The current status of the distribution.
Deployedif the distribution’s information is fully propagated throughout the Amazon CloudFront system.- {[key: string]: string}
A map of tags to assign to the resource.
- viewer
Certificate DistributionViewer Certificate The SSL configuration for this distribution (maximum one).
- wait
For booleanDeployment If enabled, the resource will wait for the distribution status to change from
InProgresstoDeployed. Setting this tofalsewill skip the process. Default:true.- web
Acl stringId If you’re using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have
waf:GetWebACLpermissions assigned. If using WAFv2, provide the ARN of the web ACL.
- active_
trusted_ Dict[str, str]signers The key pair IDs that CloudFront is aware of for each trusted signer, if the distribution is set up to serve private content with signed URLs.
- aliases List[str]
Extra CNAMEs (alternate domain names), if any, for this distribution.
- arn str
The ARN (Amazon Resource Name) for the distribution. For example:
arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where123456789012is your AWS account ID.- caller_
reference str Internal value used by CloudFront to allow future updates to the distribution configuration.
- comment str
Any comments you want to include about the distribution.
- custom_
error_ List[Distributionresponses Custom Error Response] One or more custom error response elements (multiples allowed).
- default_
cache_ Dict[Distributionbehavior Default Cache Behavior] The default cache behavior for this distribution (maximum one).
- default_
root_ strobject The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
- domain_
name str The DNS domain name of either the S3 bucket, or web site of your custom origin.
- enabled bool
Whether the distribution is enabled to accept end user requests for content.
- etag str
The current version of the distribution’s information. For example:
E2QWRUHAPOMQZL.- hosted_
zone_ strid The CloudFront Route 53 zone ID that can be used to route an Alias Resource Record Set to. This attribute is simply an alias for the zone ID
Z2FDTNDATAQYW2.- http_
version str The maximum HTTP version to support on the distribution. Allowed values are
http1.1andhttp2. The default ishttp2.- in_
progress_ floatvalidation_ batches The number of invalidation batches currently in progress.
- is_
ipv6_ boolenabled Whether the IPv6 is enabled for the distribution.
- last_
modified_ strtime The date and time the distribution was last modified.
- logging_
config Dict[DistributionLogging Config] The logging configuration that controls how logs are written to your distribution (maximum one).
- ordered_
cache_ List[Distributionbehaviors Ordered Cache Behavior] An ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
- origin_
groups List[DistributionOrigin Group] One or more origin_group for this distribution (multiples allowed).
- origins
List[Distribution
Origin] One or more origins for this distribution (multiples allowed).
- price_
class str The price class for this distribution. One of
PriceClass_All,PriceClass_200,PriceClass_100- restrictions
Dict[Distribution
Restrictions] The restriction configuration for this distribution (maximum one).
- retain_
on_ booldelete Disables the distribution instead of deleting it when destroying the resource. If this is set, the distribution needs to be deleted manually afterwards. Default:
false.- status str
The current status of the distribution.
Deployedif the distribution’s information is fully propagated throughout the Amazon CloudFront system.- Dict[str, str]
A map of tags to assign to the resource.
- viewer_
certificate Dict[DistributionViewer Certificate] The SSL configuration for this distribution (maximum one).
- wait_
for_ booldeployment If enabled, the resource will wait for the distribution status to change from
InProgresstoDeployed. Setting this tofalsewill skip the process. Default:true.- web_
acl_ strid If you’re using AWS WAF to filter CloudFront requests, the Id of the AWS WAF web ACL that is associated with the distribution. The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have
waf:GetWebACLpermissions assigned. If using WAFv2, provide the ARN of the web ACL.
Supporting Types
DistributionCustomErrorResponse
- Error
Code int The 4xx or 5xx HTTP status code that you want to customize.
- Error
Caching intMin Ttl The minimum amount of time you want HTTP error codes to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated.
- Response
Code int The HTTP status code that you want CloudFront to return with the custom error page to the viewer.
- Response
Page stringPath The path of the custom error page (for example,
/custom_404.html).
- Error
Code int The 4xx or 5xx HTTP status code that you want to customize.
- Error
Caching intMin Ttl The minimum amount of time you want HTTP error codes to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated.
- Response
Code int The HTTP status code that you want CloudFront to return with the custom error page to the viewer.
- Response
Page stringPath The path of the custom error page (for example,
/custom_404.html).
- error
Code number The 4xx or 5xx HTTP status code that you want to customize.
- error
Caching numberMin Ttl The minimum amount of time you want HTTP error codes to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated.
- response
Code number The HTTP status code that you want CloudFront to return with the custom error page to the viewer.
- response
Page stringPath The path of the custom error page (for example,
/custom_404.html).
- error
Code float The 4xx or 5xx HTTP status code that you want to customize.
- error
Caching floatMin Ttl The minimum amount of time you want HTTP error codes to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated.
- response
Code float The HTTP status code that you want CloudFront to return with the custom error page to the viewer.
- response
Page strPath The path of the custom error page (for example,
/custom_404.html).
DistributionDefaultCacheBehavior
- Allowed
Methods List<string> Controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin.
- Cached
Methods List<string> Controls whether CloudFront caches the response to requests using the specified HTTP methods.
- Forwarded
Values DistributionDefault Cache Behavior Forwarded Values Args The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers (maximum one).
- Target
Origin stringId The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior.
- Viewer
Protocol stringPolicy Use this element to specify the protocol that users can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern. One of
allow-all,https-only, orredirect-to-https.- Compress bool
Whether you want CloudFront to automatically compress content for web requests that include
Accept-Encoding: gzipin the request header (default:false).- Default
Ttl int The default amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request in the absence of an
Cache-Control max-ageorExpiresheader. Defaults to 1 day.- Field
Level stringEncryption Id Field level encryption configuration ID
- Lambda
Function List<DistributionAssociations Default Cache Behavior Lambda Function Association Args> A config block that triggers a lambda function with specific actions. Defined below, maximum 4.
- Max
Ttl int The maximum amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request to your origin to determine whether the object has been updated. Only effective in the presence of
Cache-Control max-age,Cache-Control s-maxage, andExpiresheaders. Defaults to 365 days.- Min
Ttl int The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. Defaults to 0 seconds.
- Smooth
Streaming bool Indicates whether you want to distribute media files in Microsoft Smooth Streaming format using the origin that is associated with this cache behavior.
- Trusted
Signers List<string> The AWS accounts, if any, that you want to allow to create signed URLs for private content.
- Allowed
Methods []string Controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin.
- Cached
Methods []string Controls whether CloudFront caches the response to requests using the specified HTTP methods.
- Forwarded
Values DistributionDefault Cache Behavior Forwarded Values The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers (maximum one).
- Target
Origin stringId The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior.
- Viewer
Protocol stringPolicy Use this element to specify the protocol that users can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern. One of
allow-all,https-only, orredirect-to-https.- Compress bool
Whether you want CloudFront to automatically compress content for web requests that include
Accept-Encoding: gzipin the request header (default:false).- Default
Ttl int The default amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request in the absence of an
Cache-Control max-ageorExpiresheader. Defaults to 1 day.- Field
Level stringEncryption Id Field level encryption configuration ID
- Lambda
Function []DistributionAssociations Default Cache Behavior Lambda Function Association A config block that triggers a lambda function with specific actions. Defined below, maximum 4.
- Max
Ttl int The maximum amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request to your origin to determine whether the object has been updated. Only effective in the presence of
Cache-Control max-age,Cache-Control s-maxage, andExpiresheaders. Defaults to 365 days.- Min
Ttl int The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. Defaults to 0 seconds.
- Smooth
Streaming bool Indicates whether you want to distribute media files in Microsoft Smooth Streaming format using the origin that is associated with this cache behavior.
- Trusted
Signers []string The AWS accounts, if any, that you want to allow to create signed URLs for private content.
- allowed
Methods string[] Controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin.
- cached
Methods string[] Controls whether CloudFront caches the response to requests using the specified HTTP methods.
- forwarded
Values DistributionDefault Cache Behavior Forwarded Values The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers (maximum one).
- target
Origin stringId The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior.
- viewer
Protocol stringPolicy Use this element to specify the protocol that users can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern. One of
allow-all,https-only, orredirect-to-https.- compress boolean
Whether you want CloudFront to automatically compress content for web requests that include
Accept-Encoding: gzipin the request header (default:false).- default
Ttl number The default amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request in the absence of an
Cache-Control max-ageorExpiresheader. Defaults to 1 day.- field
Level stringEncryption Id Field level encryption configuration ID
- lambda
Function DistributionAssociations Default Cache Behavior Lambda Function Association[] A config block that triggers a lambda function with specific actions. Defined below, maximum 4.
- max
Ttl number The maximum amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request to your origin to determine whether the object has been updated. Only effective in the presence of
Cache-Control max-age,Cache-Control s-maxage, andExpiresheaders. Defaults to 365 days.- min
Ttl number The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. Defaults to 0 seconds.
- smooth
Streaming boolean Indicates whether you want to distribute media files in Microsoft Smooth Streaming format using the origin that is associated with this cache behavior.
- trusted
Signers string[] The AWS accounts, if any, that you want to allow to create signed URLs for private content.
- allowed
Methods List[str] Controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin.
- cached
Methods List[str] Controls whether CloudFront caches the response to requests using the specified HTTP methods.
- forwarded
Values Dict[DistributionDefault Cache Behavior Forwarded Values] The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers (maximum one).
- target
Origin strId The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior.
- viewer
Protocol strPolicy Use this element to specify the protocol that users can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern. One of
allow-all,https-only, orredirect-to-https.- compress bool
Whether you want CloudFront to automatically compress content for web requests that include
Accept-Encoding: gzipin the request header (default:false).- default
Ttl float The default amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request in the absence of an
Cache-Control max-ageorExpiresheader. Defaults to 1 day.- field
Level strEncryption Id Field level encryption configuration ID
- lambda
Function List[DistributionAssociations Default Cache Behavior Lambda Function Association] A config block that triggers a lambda function with specific actions. Defined below, maximum 4.
- max
Ttl float The maximum amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request to your origin to determine whether the object has been updated. Only effective in the presence of
Cache-Control max-age,Cache-Control s-maxage, andExpiresheaders. Defaults to 365 days.- min
Ttl float The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. Defaults to 0 seconds.
- smooth
Streaming bool Indicates whether you want to distribute media files in Microsoft Smooth Streaming format using the origin that is associated with this cache behavior.
- trusted
Signers List[str] The AWS accounts, if any, that you want to allow to create signed URLs for private content.
DistributionDefaultCacheBehaviorForwardedValues
-
Distribution
Default Cache Behavior Forwarded Values Cookies Args The forwarded values cookies that specifies how CloudFront handles cookies (maximum one).
- Query
String bool Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior.
- Headers List<string>
Specifies the Headers, if any, that you want CloudFront to vary upon for this cache behavior. Specify
*to include all headers.- Query
String List<string>Cache Keys When specified, along with a value of
trueforquery_string, all query strings are forwarded, however only the query string keys listed in this argument are cached. When omitted with a value oftrueforquery_string, all query string keys are cached.
-
Distribution
Default Cache Behavior Forwarded Values Cookies The forwarded values cookies that specifies how CloudFront handles cookies (maximum one).
- Query
String bool Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior.
- Headers []string
Specifies the Headers, if any, that you want CloudFront to vary upon for this cache behavior. Specify
*to include all headers.- Query
String []stringCache Keys When specified, along with a value of
trueforquery_string, all query strings are forwarded, however only the query string keys listed in this argument are cached. When omitted with a value oftrueforquery_string, all query string keys are cached.
-
Distribution
Default Cache Behavior Forwarded Values Cookies The forwarded values cookies that specifies how CloudFront handles cookies (maximum one).
- query
String boolean Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior.
- headers string[]
Specifies the Headers, if any, that you want CloudFront to vary upon for this cache behavior. Specify
*to include all headers.- query
String string[]Cache Keys When specified, along with a value of
trueforquery_string, all query strings are forwarded, however only the query string keys listed in this argument are cached. When omitted with a value oftrueforquery_string, all query string keys are cached.
-
Dict[Distribution
Default Cache Behavior Forwarded Values Cookies] The forwarded values cookies that specifies how CloudFront handles cookies (maximum one).
- query
String bool Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior.
- headers List[str]
Specifies the Headers, if any, that you want CloudFront to vary upon for this cache behavior. Specify
*to include all headers.- query
String List[str]Cache Keys When specified, along with a value of
trueforquery_string, all query strings are forwarded, however only the query string keys listed in this argument are cached. When omitted with a value oftrueforquery_string, all query string keys are cached.
DistributionDefaultCacheBehaviorForwardedValuesCookies
- Forward string
Specifies whether you want CloudFront to forward cookies to the origin that is associated with this cache behavior. You can specify
all,noneorwhitelist. Ifwhitelist, you must include the subsequentwhitelisted_names- Whitelisted
Names List<string> If you have specified
whitelisttoforward, the whitelisted cookies that you want CloudFront to forward to your origin.
- Forward string
Specifies whether you want CloudFront to forward cookies to the origin that is associated with this cache behavior. You can specify
all,noneorwhitelist. Ifwhitelist, you must include the subsequentwhitelisted_names- Whitelisted
Names []string If you have specified
whitelisttoforward, the whitelisted cookies that you want CloudFront to forward to your origin.
- forward string
Specifies whether you want CloudFront to forward cookies to the origin that is associated with this cache behavior. You can specify
all,noneorwhitelist. Ifwhitelist, you must include the subsequentwhitelisted_names- whitelisted
Names string[] If you have specified
whitelisttoforward, the whitelisted cookies that you want CloudFront to forward to your origin.
- forward str
Specifies whether you want CloudFront to forward cookies to the origin that is associated with this cache behavior. You can specify
all,noneorwhitelist. Ifwhitelist, you must include the subsequentwhitelisted_names- whitelisted
Names List[str] If you have specified
whitelisttoforward, the whitelisted cookies that you want CloudFront to forward to your origin.
DistributionDefaultCacheBehaviorLambdaFunctionAssociation
- Event
Type string The specific event to trigger this function. Valid values:
viewer-request,origin-request,viewer-response,origin-response- Lambda
Arn string ARN of the Lambda function.
- Include
Body bool When set to true it exposes the request body to the lambda function. Defaults to false. Valid values:
true,false.
- Event
Type string The specific event to trigger this function. Valid values:
viewer-request,origin-request,viewer-response,origin-response- Lambda
Arn string ARN of the Lambda function.
- Include
Body bool When set to true it exposes the request body to the lambda function. Defaults to false. Valid values:
true,false.
- event
Type string The specific event to trigger this function. Valid values:
viewer-request,origin-request,viewer-response,origin-response- lambda
Arn string ARN of the Lambda function.
- include
Body boolean When set to true it exposes the request body to the lambda function. Defaults to false. Valid values:
true,false.
- event
Type str The specific event to trigger this function. Valid values:
viewer-request,origin-request,viewer-response,origin-response- lambda
Arn str ARN of the Lambda function.
- include
Body bool When set to true it exposes the request body to the lambda function. Defaults to false. Valid values:
true,false.
DistributionLoggingConfig
- Bucket string
The Amazon S3 bucket to store the access logs in, for example,
myawslogbucket.s3.amazonaws.com.- bool
Specifies whether you want CloudFront to include cookies in access logs (default:
false).- Prefix string
An optional string that you want CloudFront to prefix to the access log filenames for this distribution, for example,
myprefix/.
- Bucket string
The Amazon S3 bucket to store the access logs in, for example,
myawslogbucket.s3.amazonaws.com.- bool
Specifies whether you want CloudFront to include cookies in access logs (default:
false).- Prefix string
An optional string that you want CloudFront to prefix to the access log filenames for this distribution, for example,
myprefix/.
- bucket string
The Amazon S3 bucket to store the access logs in, for example,
myawslogbucket.s3.amazonaws.com.- boolean
Specifies whether you want CloudFront to include cookies in access logs (default:
false).- prefix string
An optional string that you want CloudFront to prefix to the access log filenames for this distribution, for example,
myprefix/.
- bucket str
The Amazon S3 bucket to store the access logs in, for example,
myawslogbucket.s3.amazonaws.com.- bool
Specifies whether you want CloudFront to include cookies in access logs (default:
false).- prefix str
An optional string that you want CloudFront to prefix to the access log filenames for this distribution, for example,
myprefix/.
DistributionOrderedCacheBehavior
- Allowed
Methods List<string> Controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin.
- Cached
Methods List<string> Controls whether CloudFront caches the response to requests using the specified HTTP methods.
- Forwarded
Values DistributionOrdered Cache Behavior Forwarded Values Args The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers (maximum one).
- Path
Pattern string The pattern (for example,
images/*.jpg)that specifies which requests you want this cache behavior to apply to.- Target
Origin stringId The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior.
- Viewer
Protocol stringPolicy Use this element to specify the protocol that users can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern. One of
allow-all,https-only, orredirect-to-https.- Compress bool
Whether you want CloudFront to automatically compress content for web requests that include
Accept-Encoding: gzipin the request header (default:false).- Default
Ttl int The default amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request in the absence of an
Cache-Control max-ageorExpiresheader. Defaults to 1 day.- Field
Level stringEncryption Id Field level encryption configuration ID
- Lambda
Function List<DistributionAssociations Ordered Cache Behavior Lambda Function Association Args> A config block that triggers a lambda function with specific actions. Defined below, maximum 4.
- Max
Ttl int The maximum amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request to your origin to determine whether the object has been updated. Only effective in the presence of
Cache-Control max-age,Cache-Control s-maxage, andExpiresheaders. Defaults to 365 days.- Min
Ttl int The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. Defaults to 0 seconds.
- Smooth
Streaming bool Indicates whether you want to distribute media files in Microsoft Smooth Streaming format using the origin that is associated with this cache behavior.
- Trusted
Signers List<string> The AWS accounts, if any, that you want to allow to create signed URLs for private content.
- Allowed
Methods []string Controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin.
- Cached
Methods []string Controls whether CloudFront caches the response to requests using the specified HTTP methods.
- Forwarded
Values DistributionOrdered Cache Behavior Forwarded Values The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers (maximum one).
- Path
Pattern string The pattern (for example,
images/*.jpg)that specifies which requests you want this cache behavior to apply to.- Target
Origin stringId The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior.
- Viewer
Protocol stringPolicy Use this element to specify the protocol that users can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern. One of
allow-all,https-only, orredirect-to-https.- Compress bool
Whether you want CloudFront to automatically compress content for web requests that include
Accept-Encoding: gzipin the request header (default:false).- Default
Ttl int The default amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request in the absence of an
Cache-Control max-ageorExpiresheader. Defaults to 1 day.- Field
Level stringEncryption Id Field level encryption configuration ID
- Lambda
Function []DistributionAssociations Ordered Cache Behavior Lambda Function Association A config block that triggers a lambda function with specific actions. Defined below, maximum 4.
- Max
Ttl int The maximum amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request to your origin to determine whether the object has been updated. Only effective in the presence of
Cache-Control max-age,Cache-Control s-maxage, andExpiresheaders. Defaults to 365 days.- Min
Ttl int The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. Defaults to 0 seconds.
- Smooth
Streaming bool Indicates whether you want to distribute media files in Microsoft Smooth Streaming format using the origin that is associated with this cache behavior.
- Trusted
Signers []string The AWS accounts, if any, that you want to allow to create signed URLs for private content.
- allowed
Methods string[] Controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin.
- cached
Methods string[] Controls whether CloudFront caches the response to requests using the specified HTTP methods.
- forwarded
Values DistributionOrdered Cache Behavior Forwarded Values The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers (maximum one).
- path
Pattern string The pattern (for example,
images/*.jpg)that specifies which requests you want this cache behavior to apply to.- target
Origin stringId The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior.
- viewer
Protocol stringPolicy Use this element to specify the protocol that users can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern. One of
allow-all,https-only, orredirect-to-https.- compress boolean
Whether you want CloudFront to automatically compress content for web requests that include
Accept-Encoding: gzipin the request header (default:false).- default
Ttl number The default amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request in the absence of an
Cache-Control max-ageorExpiresheader. Defaults to 1 day.- field
Level stringEncryption Id Field level encryption configuration ID
- lambda
Function DistributionAssociations Ordered Cache Behavior Lambda Function Association[] A config block that triggers a lambda function with specific actions. Defined below, maximum 4.
- max
Ttl number The maximum amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request to your origin to determine whether the object has been updated. Only effective in the presence of
Cache-Control max-age,Cache-Control s-maxage, andExpiresheaders. Defaults to 365 days.- min
Ttl number The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. Defaults to 0 seconds.
- smooth
Streaming boolean Indicates whether you want to distribute media files in Microsoft Smooth Streaming format using the origin that is associated with this cache behavior.
- trusted
Signers string[] The AWS accounts, if any, that you want to allow to create signed URLs for private content.
- allowed
Methods List[str] Controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin.
- cached
Methods List[str] Controls whether CloudFront caches the response to requests using the specified HTTP methods.
- forwarded
Values Dict[DistributionOrdered Cache Behavior Forwarded Values] The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers (maximum one).
- path
Pattern str The pattern (for example,
images/*.jpg)that specifies which requests you want this cache behavior to apply to.- target
Origin strId The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior.
- viewer
Protocol strPolicy Use this element to specify the protocol that users can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern. One of
allow-all,https-only, orredirect-to-https.- compress bool
Whether you want CloudFront to automatically compress content for web requests that include
Accept-Encoding: gzipin the request header (default:false).- default
Ttl float The default amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request in the absence of an
Cache-Control max-ageorExpiresheader. Defaults to 1 day.- field
Level strEncryption Id Field level encryption configuration ID
- lambda
Function List[DistributionAssociations Ordered Cache Behavior Lambda Function Association] A config block that triggers a lambda function with specific actions. Defined below, maximum 4.
- max
Ttl float The maximum amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request to your origin to determine whether the object has been updated. Only effective in the presence of
Cache-Control max-age,Cache-Control s-maxage, andExpiresheaders. Defaults to 365 days.- min
Ttl float The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated. Defaults to 0 seconds.
- smooth
Streaming bool Indicates whether you want to distribute media files in Microsoft Smooth Streaming format using the origin that is associated with this cache behavior.
- trusted
Signers List[str] The AWS accounts, if any, that you want to allow to create signed URLs for private content.
DistributionOrderedCacheBehaviorForwardedValues
-
Distribution
Ordered Cache Behavior Forwarded Values Cookies Args The forwarded values cookies that specifies how CloudFront handles cookies (maximum one).
- Query
String bool Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior.
- Headers List<string>
Specifies the Headers, if any, that you want CloudFront to vary upon for this cache behavior. Specify
*to include all headers.- Query
String List<string>Cache Keys When specified, along with a value of
trueforquery_string, all query strings are forwarded, however only the query string keys listed in this argument are cached. When omitted with a value oftrueforquery_string, all query string keys are cached.
-
Distribution
Ordered Cache Behavior Forwarded Values Cookies The forwarded values cookies that specifies how CloudFront handles cookies (maximum one).
- Query
String bool Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior.
- Headers []string
Specifies the Headers, if any, that you want CloudFront to vary upon for this cache behavior. Specify
*to include all headers.- Query
String []stringCache Keys When specified, along with a value of
trueforquery_string, all query strings are forwarded, however only the query string keys listed in this argument are cached. When omitted with a value oftrueforquery_string, all query string keys are cached.
-
Distribution
Ordered Cache Behavior Forwarded Values Cookies The forwarded values cookies that specifies how CloudFront handles cookies (maximum one).
- query
String boolean Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior.
- headers string[]
Specifies the Headers, if any, that you want CloudFront to vary upon for this cache behavior. Specify
*to include all headers.- query
String string[]Cache Keys When specified, along with a value of
trueforquery_string, all query strings are forwarded, however only the query string keys listed in this argument are cached. When omitted with a value oftrueforquery_string, all query string keys are cached.
-
Dict[Distribution
Ordered Cache Behavior Forwarded Values Cookies] The forwarded values cookies that specifies how CloudFront handles cookies (maximum one).
- query
String bool Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior.
- headers List[str]
Specifies the Headers, if any, that you want CloudFront to vary upon for this cache behavior. Specify
*to include all headers.- query
String List[str]Cache Keys When specified, along with a value of
trueforquery_string, all query strings are forwarded, however only the query string keys listed in this argument are cached. When omitted with a value oftrueforquery_string, all query string keys are cached.
DistributionOrderedCacheBehaviorForwardedValuesCookies
- Forward string
Specifies whether you want CloudFront to forward cookies to the origin that is associated with this cache behavior. You can specify
all,noneorwhitelist. Ifwhitelist, you must include the subsequentwhitelisted_names- Whitelisted
Names List<string> If you have specified
whitelisttoforward, the whitelisted cookies that you want CloudFront to forward to your origin.
- Forward string
Specifies whether you want CloudFront to forward cookies to the origin that is associated with this cache behavior. You can specify
all,noneorwhitelist. Ifwhitelist, you must include the subsequentwhitelisted_names- Whitelisted
Names []string If you have specified
whitelisttoforward, the whitelisted cookies that you want CloudFront to forward to your origin.
- forward string
Specifies whether you want CloudFront to forward cookies to the origin that is associated with this cache behavior. You can specify
all,noneorwhitelist. Ifwhitelist, you must include the subsequentwhitelisted_names- whitelisted
Names string[] If you have specified
whitelisttoforward, the whitelisted cookies that you want CloudFront to forward to your origin.
- forward str
Specifies whether you want CloudFront to forward cookies to the origin that is associated with this cache behavior. You can specify
all,noneorwhitelist. Ifwhitelist, you must include the subsequentwhitelisted_names- whitelisted
Names List[str] If you have specified
whitelisttoforward, the whitelisted cookies that you want CloudFront to forward to your origin.
DistributionOrderedCacheBehaviorLambdaFunctionAssociation
- Event
Type string The specific event to trigger this function. Valid values:
viewer-request,origin-request,viewer-response,origin-response- Lambda
Arn string ARN of the Lambda function.
- Include
Body bool When set to true it exposes the request body to the lambda function. Defaults to false. Valid values:
true,false.
- Event
Type string The specific event to trigger this function. Valid values:
viewer-request,origin-request,viewer-response,origin-response- Lambda
Arn string ARN of the Lambda function.
- Include
Body bool When set to true it exposes the request body to the lambda function. Defaults to false. Valid values:
true,false.
- event
Type string The specific event to trigger this function. Valid values:
viewer-request,origin-request,viewer-response,origin-response- lambda
Arn string ARN of the Lambda function.
- include
Body boolean When set to true it exposes the request body to the lambda function. Defaults to false. Valid values:
true,false.
- event
Type str The specific event to trigger this function. Valid values:
viewer-request,origin-request,viewer-response,origin-response- lambda
Arn str ARN of the Lambda function.
- include
Body bool When set to true it exposes the request body to the lambda function. Defaults to false. Valid values:
true,false.
DistributionOrigin
- Domain
Name string The DNS domain name of either the S3 bucket, or web site of your custom origin.
- Origin
Id string The unique identifier of the member origin
- Custom
Headers List<DistributionOrigin Custom Header Args> One or more sub-resources with
nameandvalueparameters that specify header data that will be sent to the origin (multiples allowed).- Custom
Origin DistributionConfig Origin Custom Origin Config Args The CloudFront custom origin configuration information. If an S3 origin is required, use
s3_origin_configinstead.- Origin
Path string An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin.
- S3Origin
Config DistributionOrigin S3Origin Config Args The CloudFront S3 origin configuration information. If a custom origin is required, use
custom_origin_configinstead.
- Domain
Name string The DNS domain name of either the S3 bucket, or web site of your custom origin.
- Origin
Id string The unique identifier of the member origin
- Custom
Headers []DistributionOrigin Custom Header One or more sub-resources with
nameandvalueparameters that specify header data that will be sent to the origin (multiples allowed).- Custom
Origin DistributionConfig Origin Custom Origin Config The CloudFront custom origin configuration information. If an S3 origin is required, use
s3_origin_configinstead.- Origin
Path string An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin.
- S3Origin
Config DistributionOrigin S3Origin Config The CloudFront S3 origin configuration information. If a custom origin is required, use
custom_origin_configinstead.
- domain
Name string The DNS domain name of either the S3 bucket, or web site of your custom origin.
- origin
Id string The unique identifier of the member origin
- custom
Headers DistributionOrigin Custom Header[] One or more sub-resources with
nameandvalueparameters that specify header data that will be sent to the origin (multiples allowed).- custom
Origin DistributionConfig Origin Custom Origin Config The CloudFront custom origin configuration information. If an S3 origin is required, use
s3_origin_configinstead.- origin
Path string An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin.
- s3Origin
Config DistributionOrigin S3Origin Config The CloudFront S3 origin configuration information. If a custom origin is required, use
custom_origin_configinstead.
- domain_
name str The DNS domain name of either the S3 bucket, or web site of your custom origin.
- origin
Id str The unique identifier of the member origin
- custom
Headers List[DistributionOrigin Custom Header] One or more sub-resources with
nameandvalueparameters that specify header data that will be sent to the origin (multiples allowed).- custom
Origin Dict[DistributionConfig Origin Custom Origin Config] The CloudFront custom origin configuration information. If an S3 origin is required, use
s3_origin_configinstead.- origin
Path str An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin.
- s3Origin
Config Dict[DistributionOrigin S3Origin Config] The CloudFront S3 origin configuration information. If a custom origin is required, use
custom_origin_configinstead.
DistributionOriginCustomHeader
DistributionOriginCustomOriginConfig
- Http
Port int The HTTP port the custom origin listens on.
- Https
Port int The HTTPS port the custom origin listens on.
- Origin
Protocol stringPolicy The origin protocol policy to apply to your origin. One of
http-only,https-only, ormatch-viewer.- Origin
Ssl List<string>Protocols The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. A list of one or more of
SSLv3,TLSv1,TLSv1.1, andTLSv1.2.- Origin
Keepalive intTimeout The Custom KeepAlive timeout, in seconds. By default, AWS enforces a limit of
60. But you can request an increase.- Origin
Read intTimeout The Custom Read timeout, in seconds. By default, AWS enforces a limit of
60. But you can request an increase.
- Http
Port int The HTTP port the custom origin listens on.
- Https
Port int The HTTPS port the custom origin listens on.
- Origin
Protocol stringPolicy The origin protocol policy to apply to your origin. One of
http-only,https-only, ormatch-viewer.- Origin
Ssl []stringProtocols The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. A list of one or more of
SSLv3,TLSv1,TLSv1.1, andTLSv1.2.- Origin
Keepalive intTimeout The Custom KeepAlive timeout, in seconds. By default, AWS enforces a limit of
60. But you can request an increase.- Origin
Read intTimeout The Custom Read timeout, in seconds. By default, AWS enforces a limit of
60. But you can request an increase.
- http
Port number The HTTP port the custom origin listens on.
- https
Port number The HTTPS port the custom origin listens on.
- origin
Protocol stringPolicy The origin protocol policy to apply to your origin. One of
http-only,https-only, ormatch-viewer.- origin
Ssl string[]Protocols The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. A list of one or more of
SSLv3,TLSv1,TLSv1.1, andTLSv1.2.- origin
Keepalive numberTimeout The Custom KeepAlive timeout, in seconds. By default, AWS enforces a limit of
60. But you can request an increase.- origin
Read numberTimeout The Custom Read timeout, in seconds. By default, AWS enforces a limit of
60. But you can request an increase.
- http
Port float The HTTP port the custom origin listens on.
- https
Port float The HTTPS port the custom origin listens on.
- origin
Protocol strPolicy The origin protocol policy to apply to your origin. One of
http-only,https-only, ormatch-viewer.- origin
Ssl List[str]Protocols The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. A list of one or more of
SSLv3,TLSv1,TLSv1.1, andTLSv1.2.- origin
Keepalive floatTimeout The Custom KeepAlive timeout, in seconds. By default, AWS enforces a limit of
60. But you can request an increase.- origin
Read floatTimeout The Custom Read timeout, in seconds. By default, AWS enforces a limit of
60. But you can request an increase.
DistributionOriginGroup
- Failover
Criteria DistributionOrigin Group Failover Criteria Args The failover criteria for when to failover to the secondary origin
- Members
List<Distribution
Origin Group Member Args> Ordered member configuration blocks assigned to the origin group, where the first member is the primary origin. You must specify two members.
- Origin
Id string The unique identifier of the member origin
- Failover
Criteria DistributionOrigin Group Failover Criteria The failover criteria for when to failover to the secondary origin
- Members
[]Distribution
Origin Group Member Ordered member configuration blocks assigned to the origin group, where the first member is the primary origin. You must specify two members.
- Origin
Id string The unique identifier of the member origin
- failover
Criteria DistributionOrigin Group Failover Criteria The failover criteria for when to failover to the secondary origin
- members
Distribution
Origin Group Member[] Ordered member configuration blocks assigned to the origin group, where the first member is the primary origin. You must specify two members.
- origin
Id string The unique identifier of the member origin
- failover
Criteria Dict[DistributionOrigin Group Failover Criteria] The failover criteria for when to failover to the secondary origin
- members
List[Distribution
Origin Group Member] Ordered member configuration blocks assigned to the origin group, where the first member is the primary origin. You must specify two members.
- origin
Id str The unique identifier of the member origin
DistributionOriginGroupFailoverCriteria
- Status
Codes List<int> A list of HTTP status codes for the origin group
- Status
Codes []int A list of HTTP status codes for the origin group
- status
Codes number[] A list of HTTP status codes for the origin group
- status
Codes List[Integer] A list of HTTP status codes for the origin group
DistributionOriginGroupMember
DistributionOriginS3OriginConfig
- Origin
Access stringIdentity The [CloudFront origin access identity][5] to associate with the origin.
- Origin
Access stringIdentity The [CloudFront origin access identity][5] to associate with the origin.
- origin
Access stringIdentity The [CloudFront origin access identity][5] to associate with the origin.
- origin
Access strIdentity The [CloudFront origin access identity][5] to associate with the origin.
DistributionRestrictions
DistributionRestrictionsGeoRestriction
- Restriction
Type string The method that you want to use to restrict distribution of your content by country:
none,whitelist, orblacklist.- Locations List<string>
The [ISO 3166-1-alpha-2 codes][4] for which you want CloudFront either to distribute your content (
whitelist) or not distribute your content (blacklist).
- Restriction
Type string The method that you want to use to restrict distribution of your content by country:
none,whitelist, orblacklist.- Locations []string
The [ISO 3166-1-alpha-2 codes][4] for which you want CloudFront either to distribute your content (
whitelist) or not distribute your content (blacklist).
- restriction
Type string The method that you want to use to restrict distribution of your content by country:
none,whitelist, orblacklist.- locations string[]
The [ISO 3166-1-alpha-2 codes][4] for which you want CloudFront either to distribute your content (
whitelist) or not distribute your content (blacklist).
- restriction
Type str The method that you want to use to restrict distribution of your content by country:
none,whitelist, orblacklist.- locations List[str]
The [ISO 3166-1-alpha-2 codes][4] for which you want CloudFront either to distribute your content (
whitelist) or not distribute your content (blacklist).
DistributionViewerCertificate
- Acm
Certificate stringArn The ARN of the AWS Certificate Manager certificate that you wish to use with this distribution. Specify this,
cloudfront_default_certificate, oriam_certificate_id. The ACM certificate must be in US-EAST-1.- Cloudfront
Default boolCertificate trueif you want viewers to use HTTPS to request your objects and you’re using the CloudFront domain name for your distribution. Specify this,acm_certificate_arn, oriam_certificate_id.- Iam
Certificate stringId The IAM certificate identifier of the custom viewer certificate for this distribution if you are using a custom domain. Specify this,
acm_certificate_arn, orcloudfront_default_certificate.- Minimum
Protocol stringVersion The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections. Can only be set if
cloudfront_default_certificate = false. One ofSSLv3,TLSv1,TLSv1_2016,TLSv1.1_2016orTLSv1.2_2018. Default:TLSv1. NOTE: If you are using a custom certificate (specified withacm_certificate_arnoriam_certificate_id), and have specifiedsni-onlyinssl_support_method,TLSv1or later must be specified. If you have specifiedvipinssl_support_method, onlySSLv3orTLSv1can be specified. If you have specifiedcloudfront_default_certificate,TLSv1must be specified.- Ssl
Support stringMethod
- Acm
Certificate stringArn The ARN of the AWS Certificate Manager certificate that you wish to use with this distribution. Specify this,
cloudfront_default_certificate, oriam_certificate_id. The ACM certificate must be in US-EAST-1.- Cloudfront
Default boolCertificate trueif you want viewers to use HTTPS to request your objects and you’re using the CloudFront domain name for your distribution. Specify this,acm_certificate_arn, oriam_certificate_id.- Iam
Certificate stringId The IAM certificate identifier of the custom viewer certificate for this distribution if you are using a custom domain. Specify this,
acm_certificate_arn, orcloudfront_default_certificate.- Minimum
Protocol stringVersion The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections. Can only be set if
cloudfront_default_certificate = false. One ofSSLv3,TLSv1,TLSv1_2016,TLSv1.1_2016orTLSv1.2_2018. Default:TLSv1. NOTE: If you are using a custom certificate (specified withacm_certificate_arnoriam_certificate_id), and have specifiedsni-onlyinssl_support_method,TLSv1or later must be specified. If you have specifiedvipinssl_support_method, onlySSLv3orTLSv1can be specified. If you have specifiedcloudfront_default_certificate,TLSv1must be specified.- Ssl
Support stringMethod
- acm
Certificate stringArn The ARN of the AWS Certificate Manager certificate that you wish to use with this distribution. Specify this,
cloudfront_default_certificate, oriam_certificate_id. The ACM certificate must be in US-EAST-1.- cloudfront
Default booleanCertificate trueif you want viewers to use HTTPS to request your objects and you’re using the CloudFront domain name for your distribution. Specify this,acm_certificate_arn, oriam_certificate_id.- iam
Certificate stringId The IAM certificate identifier of the custom viewer certificate for this distribution if you are using a custom domain. Specify this,
acm_certificate_arn, orcloudfront_default_certificate.- minimum
Protocol stringVersion The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections. Can only be set if
cloudfront_default_certificate = false. One ofSSLv3,TLSv1,TLSv1_2016,TLSv1.1_2016orTLSv1.2_2018. Default:TLSv1. NOTE: If you are using a custom certificate (specified withacm_certificate_arnoriam_certificate_id), and have specifiedsni-onlyinssl_support_method,TLSv1or later must be specified. If you have specifiedvipinssl_support_method, onlySSLv3orTLSv1can be specified. If you have specifiedcloudfront_default_certificate,TLSv1must be specified.- ssl
Support stringMethod
- acm
Certificate strArn The ARN of the AWS Certificate Manager certificate that you wish to use with this distribution. Specify this,
cloudfront_default_certificate, oriam_certificate_id. The ACM certificate must be in US-EAST-1.- cloudfront
Default boolCertificate trueif you want viewers to use HTTPS to request your objects and you’re using the CloudFront domain name for your distribution. Specify this,acm_certificate_arn, oriam_certificate_id.- iam
Certificate strId The IAM certificate identifier of the custom viewer certificate for this distribution if you are using a custom domain. Specify this,
acm_certificate_arn, orcloudfront_default_certificate.- minimum
Protocol strVersion The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections. Can only be set if
cloudfront_default_certificate = false. One ofSSLv3,TLSv1,TLSv1_2016,TLSv1.1_2016orTLSv1.2_2018. Default:TLSv1. NOTE: If you are using a custom certificate (specified withacm_certificate_arnoriam_certificate_id), and have specifiedsni-onlyinssl_support_method,TLSv1or later must be specified. If you have specifiedvipinssl_support_method, onlySSLv3orTLSv1can be specified. If you have specifiedcloudfront_default_certificate,TLSv1must be specified.- ssl
Support strMethod
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.