Module cloudfront

cloudfront

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-aws repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-aws repo.
class pulumi_aws.cloudfront.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, origins=None, origin_groups=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, __name__=None, __opts__=None)

Creates an Amazon CloudFront web distribution.

For information about CloudFront distributions, see the [Amazon CloudFront Developer Guide][1]. For specific information about creating CloudFront web distributions, see the [POST Distribution][2] 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_delete flag.
Parameters:
  • resource_name (str) – The name of the resource.
  • opts (pulumi.ResourceOptions) – Options for the resource.
  • aliases (pulumi.Input[list]) – Extra CNAMEs (alternate domain names), if any, for this distribution.
  • comment (pulumi.Input[str]) – Any comments you want to include about the distribution.
  • custom_error_responses (pulumi.Input[list]) – One or more custom error response elements (multiples allowed).
  • default_cache_behavior (pulumi.Input[dict]) – The default cache behavior for this distribution (maximum one).
  • default_root_object (pulumi.Input[str]) – The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
  • enabled (pulumi.Input[bool]) – Whether the distribution is enabled to accept end user requests for content.
  • http_version (pulumi.Input[str]) – The maximum HTTP version to support on the distribution. Allowed values are http1.1 and http2. The default is http2.
  • is_ipv6_enabled (pulumi.Input[bool]) – Whether the IPv6 is enabled for the distribution.
  • logging_config (pulumi.Input[dict]) – The logging configuration that controls how logs are written to your distribution (maximum one).
  • ordered_cache_behaviors (pulumi.Input[list]) – 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.
  • origins (pulumi.Input[list]) – One or more origins for this distribution (multiples allowed).
  • origin_groups (pulumi.Input[list]) – One or more origin_group for this distribution (multiples allowed).
  • price_class (pulumi.Input[str]) – The price class for this distribution. One of PriceClass_All, PriceClass_200, PriceClass_100
  • restrictions (pulumi.Input[dict]) – The restriction configuration for this distribution (maximum one).
  • retain_on_delete (pulumi.Input[bool]) – 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.
  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.
  • viewer_certificate (pulumi.Input[dict]) – The SSL configuration for this distribution (maximum one).
  • wait_for_deployment (pulumi.Input[bool]) – If enabled, the resource will wait for the distribution status to change from InProgress to Deployed. Setting this tofalse will skip the process. Default: true.
  • web_acl_id (pulumi.Input[str]) – 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:GetWebACL permissions assigned.
active_trusted_signers = None

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 = None

Extra CNAMEs (alternate domain names), if any, for this distribution.

arn = None

The ARN (Amazon Resource Name) for the distribution. For example: arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where 123456789012 is your AWS account ID.

caller_reference = None

Internal value used by CloudFront to allow future updates to the distribution configuration.

comment = None

Any comments you want to include about the distribution.

custom_error_responses = None

One or more custom error response elements (multiples allowed).

default_cache_behavior = None

The default cache behavior for this distribution (maximum one).

default_root_object = None

The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.

domain_name = None

The DNS domain name of either the S3 bucket, or web site of your custom origin.

enabled = None

Whether the distribution is enabled to accept end user requests for content.

etag = None

The current version of the distribution’s information. For example: E2QWRUHAPOMQZL.

hosted_zone_id = None

The CloudFront Route 53 zone ID that can be used to route an [Alias Resource Record Set][7] to. This attribute is simply an alias for the zone ID Z2FDTNDATAQYW2.

http_version = None

The maximum HTTP version to support on the distribution. Allowed values are http1.1 and http2. The default is http2.

in_progress_validation_batches = None

The number of invalidation batches currently in progress.

is_ipv6_enabled = None

Whether the IPv6 is enabled for the distribution.

last_modified_time = None

The date and time the distribution was last modified.

logging_config = None

The logging configuration that controls how logs are written to your distribution (maximum one).

ordered_cache_behaviors = None

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.

origins = None

One or more origins for this distribution (multiples allowed).

origin_groups = None

One or more origin_group for this distribution (multiples allowed).

price_class = None

The price class for this distribution. One of PriceClass_All, PriceClass_200, PriceClass_100

restrictions = None

The restriction configuration for this distribution (maximum one).

retain_on_delete = None

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 = None

The current status of the distribution. Deployed if the distribution’s information is fully propagated throughout the Amazon CloudFront system.

tags = None

A mapping of tags to assign to the resource.

viewer_certificate = None

The SSL configuration for this distribution (maximum one).

wait_for_deployment = None

If enabled, the resource will wait for the distribution status to change from InProgress to Deployed. Setting this tofalse will skip the process. Default: true.

web_acl_id = None

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:GetWebACL permissions assigned.

static 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, origins=None, origin_groups=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)

Get an existing Distribution resource’s state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param str id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[dict] active_trusted_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.
Parameters:
  • aliases (pulumi.Input[list]) – Extra CNAMEs (alternate domain names), if any, for this distribution.
  • arn (pulumi.Input[str]) – The ARN (Amazon Resource Name) for the distribution. For example: arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where 123456789012 is your AWS account ID.
  • caller_reference (pulumi.Input[str]) – Internal value used by CloudFront to allow future updates to the distribution configuration.
  • comment (pulumi.Input[str]) – Any comments you want to include about the distribution.
  • custom_error_responses (pulumi.Input[list]) – One or more custom error response elements (multiples allowed).
  • default_cache_behavior (pulumi.Input[dict]) – The default cache behavior for this distribution (maximum one).
  • default_root_object (pulumi.Input[str]) – The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL.
  • domain_name (pulumi.Input[str]) – The DNS domain name of either the S3 bucket, or web site of your custom origin.
  • enabled (pulumi.Input[bool]) – Whether the distribution is enabled to accept end user requests for content.
  • etag (pulumi.Input[str]) – The current version of the distribution’s information. For example: E2QWRUHAPOMQZL.
  • hosted_zone_id (pulumi.Input[str]) – The CloudFront Route 53 zone ID that can be used to route an [Alias Resource Record Set][7] to. This attribute is simply an alias for the zone ID Z2FDTNDATAQYW2.
  • http_version (pulumi.Input[str]) – The maximum HTTP version to support on the distribution. Allowed values are http1.1 and http2. The default is http2.
  • in_progress_validation_batches (pulumi.Input[float]) – The number of invalidation batches currently in progress.
  • is_ipv6_enabled (pulumi.Input[bool]) – Whether the IPv6 is enabled for the distribution.
  • last_modified_time (pulumi.Input[str]) – The date and time the distribution was last modified.
  • logging_config (pulumi.Input[dict]) – The logging configuration that controls how logs are written to your distribution (maximum one).
  • ordered_cache_behaviors (pulumi.Input[list]) – 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.
  • origins (pulumi.Input[list]) – One or more origins for this distribution (multiples allowed).
  • origin_groups (pulumi.Input[list]) – One or more origin_group for this distribution (multiples allowed).
  • price_class (pulumi.Input[str]) – The price class for this distribution. One of PriceClass_All, PriceClass_200, PriceClass_100
  • restrictions (pulumi.Input[dict]) – The restriction configuration for this distribution (maximum one).
  • retain_on_delete (pulumi.Input[bool]) – 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 (pulumi.Input[str]) – The current status of the distribution. Deployed if the distribution’s information is fully propagated throughout the Amazon CloudFront system.
  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.
  • viewer_certificate (pulumi.Input[dict]) – The SSL configuration for this distribution (maximum one).
  • wait_for_deployment (pulumi.Input[bool]) – If enabled, the resource will wait for the distribution status to change from InProgress to Deployed. Setting this tofalse will skip the process. Default: true.
  • web_acl_id (pulumi.Input[str]) – 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:GetWebACL permissions assigned.
translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
class pulumi_aws.cloudfront.OriginAccessIdentity(resource_name, opts=None, comment=None, __props__=None, __name__=None, __opts__=None)

Creates an Amazon CloudFront origin access identity.

For information about CloudFront distributions, see the [Amazon CloudFront Developer Guide][1]. For more information on generating origin access identities, see [Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content][2].

Parameters:
  • resource_name (str) – The name of the resource.
  • opts (pulumi.ResourceOptions) – Options for the resource.
  • comment (pulumi.Input[str]) – An optional comment for the origin access identity.
caller_reference = None

Internal value used by CloudFront to allow future updates to the origin access identity.

cloudfront_access_identity_path = None

A shortcut to the full path for the origin access identity to use in CloudFront, see below.

comment = None

An optional comment for the origin access identity.

etag = None

The current version of the origin access identity’s information. For example: E2QWRUHAPOMQZL.

iam_arn = None

A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.

s3_canonical_user_id = None

The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.

static get(resource_name, id, opts=None, caller_reference=None, cloudfront_access_identity_path=None, comment=None, etag=None, iam_arn=None, s3_canonical_user_id=None)

Get an existing OriginAccessIdentity resource’s state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param str id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] caller_reference: Internal value used by CloudFront to allow future

updates to the origin access identity.
Parameters:
  • cloudfront_access_identity_path (pulumi.Input[str]) – A shortcut to the full path for the origin access identity to use in CloudFront, see below.
  • comment (pulumi.Input[str]) – An optional comment for the origin access identity.
  • etag (pulumi.Input[str]) – The current version of the origin access identity’s information. For example: E2QWRUHAPOMQZL.
  • iam_arn (pulumi.Input[str]) – A pre-generated ARN for use in S3 bucket policies (see below). Example: arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E2QWRUHAPOMQZL.
  • s3_canonical_user_id (pulumi.Input[str]) – The Amazon S3 canonical user ID for the origin access identity, which you use when giving the origin access identity read permission to an object in Amazon S3.
translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
class pulumi_aws.cloudfront.PublicKey(resource_name, opts=None, comment=None, encoded_key=None, name=None, name_prefix=None, __props__=None, __name__=None, __opts__=None)

Create a PublicKey resource with the given unique name, props, and options.

Parameters:
  • resource_name (str) – The name of the resource.
  • opts (pulumi.ResourceOptions) – Options for the resource.
  • comment (pulumi.Input[str]) – An optional comment about the public key.
  • encoded_key (pulumi.Input[str]) – The encoded public key that you want to add to CloudFront to use with features like field-level encryption.
  • name (pulumi.Input[str]) – The name for the public key. By default generated by this provider.
  • name_prefix (pulumi.Input[str]) – The name for the public key. Conflicts with name.
caller_reference = None

Internal value used by CloudFront to allow future updates to the public key configuration.

comment = None

An optional comment about the public key.

encoded_key = None

The encoded public key that you want to add to CloudFront to use with features like field-level encryption.

etag = None

The current version of the public key. For example: E2QWRUHAPOMQZL.

name = None

The name for the public key. By default generated by this provider.

name_prefix = None

The name for the public key. Conflicts with name.

static get(resource_name, id, opts=None, caller_reference=None, comment=None, encoded_key=None, etag=None, name=None, name_prefix=None)

Get an existing PublicKey resource’s state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param str id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] caller_reference: Internal value used by CloudFront to allow future updates to the public key configuration. :param pulumi.Input[str] comment: An optional comment about the public key. :param pulumi.Input[str] encoded_key: The encoded public key that you want to add to CloudFront to use with features like field-level encryption. :param pulumi.Input[str] etag: The current version of the public key. For example: E2QWRUHAPOMQZL. :param pulumi.Input[str] name: The name for the public key. By default generated by this provider. :param pulumi.Input[str] name_prefix: The name for the public key. Conflicts with name.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str