CloudFrontWebDistributionProps

class aws_cdk.aws_cloudfront.CloudFrontWebDistributionProps(*, origin_configs, alias_configuration=None, comment=None, default_root_object=None, enable_ip_v6=None, error_configurations=None, geo_restriction=None, http_version=None, logging_config=None, price_class=None, viewer_certificate=None, viewer_protocol_policy=None, web_acl_id=None)

Bases: object

Parameters
  • origin_configs (List[SourceConfiguration]) – (experimental) The origin configurations for this distribution. Behaviors are a part of the origin.

  • alias_configuration (Optional[AliasConfiguration]) – (deprecated) AliasConfiguration is used to configured CloudFront to respond to requests on custom domain names. Default: - None.

  • comment (Optional[str]) – (experimental) A comment for this distribution in the CloudFront console. Default: - No comment is added to distribution.

  • default_root_object (Optional[str]) – (experimental) The default object to serve. Default: - “index.html” is served.

  • enable_ip_v6 (Optional[bool]) – (experimental) If your distribution should have IPv6 enabled. Default: true

  • error_configurations (Optional[List[CustomErrorResponseProperty]]) – (experimental) How CloudFront should handle requests that are not successful (eg PageNotFound). By default, CloudFront does not replace HTTP status codes in the 4xx and 5xx range with custom error messages. CloudFront does not cache HTTP status codes. Default: - No custom error configuration.

  • geo_restriction (Optional[GeoRestriction]) – (experimental) Controls the countries in which your content is distributed. Default: No geo restriction

  • http_version (Optional[HttpVersion]) – (experimental) The max supported HTTP Versions. Default: HttpVersion.HTTP2

  • logging_config (Optional[LoggingConfiguration]) – (experimental) Optional - if we should enable logging. You can pass an empty object ({}) to have us auto create a bucket for logging. Omission of this property indicates no logging is to be enabled. Default: - no logging is enabled by default.

  • price_class (Optional[PriceClass]) – (experimental) The price class for the distribution (this impacts how many locations CloudFront uses for your distribution, and billing). Default: PriceClass.PRICE_CLASS_100 the cheapest option for CloudFront is picked by default.

  • viewer_certificate (Optional[ViewerCertificate]) – (experimental) Specifies whether you want viewers to use HTTP or HTTPS to request your objects, whether you’re using an alternate domain name with HTTPS, and if so, if you’re using AWS Certificate Manager (ACM) or a third-party certificate authority. Default: ViewerCertificate.fromCloudFrontDefaultCertificate()

  • viewer_protocol_policy (Optional[ViewerProtocolPolicy]) – (experimental) The default viewer policy for incoming clients. Default: RedirectToHTTPs

  • web_acl_id (Optional[str]) – (experimental) Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution. To specify a web ACL created using the latest version of AWS WAF, use the ACL ARN, for example arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a. To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example 473e64fd-f30b-4765-81a0-62ad96dd167a. Default: - No AWS Web Application Firewall web access control list (web ACL).

Stability

experimental

Attributes

alias_configuration

(deprecated) AliasConfiguration is used to configured CloudFront to respond to requests on custom domain names.

Default
  • None.

Deprecated

see {@link CloudFrontWebDistributionProps#viewerCertificate} with {@link ViewerCertificate#acmCertificate}

Stability

deprecated

Return type

Optional[AliasConfiguration]

comment

(experimental) A comment for this distribution in the CloudFront console.

Default
  • No comment is added to distribution.

Stability

experimental

Return type

Optional[str]

default_root_object

(experimental) The default object to serve.

Default
  • “index.html” is served.

Stability

experimental

Return type

Optional[str]

enable_ip_v6

(experimental) If your distribution should have IPv6 enabled.

Default

true

Stability

experimental

Return type

Optional[bool]

error_configurations

(experimental) How CloudFront should handle requests that are not successful (eg PageNotFound).

By default, CloudFront does not replace HTTP status codes in the 4xx and 5xx range with custom error messages. CloudFront does not cache HTTP status codes.

Default
  • No custom error configuration.

Stability

experimental

Return type

Optional[List[CustomErrorResponseProperty]]

geo_restriction

(experimental) Controls the countries in which your content is distributed.

Default

No geo restriction

Stability

experimental

Return type

Optional[GeoRestriction]

http_version

(experimental) The max supported HTTP Versions.

Default

HttpVersion.HTTP2

Stability

experimental

Return type

Optional[HttpVersion]

logging_config

(experimental) Optional - if we should enable logging.

You can pass an empty object ({}) to have us auto create a bucket for logging. Omission of this property indicates no logging is to be enabled.

Default
  • no logging is enabled by default.

Stability

experimental

Return type

Optional[LoggingConfiguration]

origin_configs

(experimental) The origin configurations for this distribution.

Behaviors are a part of the origin.

Stability

experimental

Return type

List[SourceConfiguration]

price_class

(experimental) The price class for the distribution (this impacts how many locations CloudFront uses for your distribution, and billing).

Default

PriceClass.PRICE_CLASS_100 the cheapest option for CloudFront is picked by default.

Stability

experimental

Return type

Optional[PriceClass]

viewer_certificate

(experimental) Specifies whether you want viewers to use HTTP or HTTPS to request your objects, whether you’re using an alternate domain name with HTTPS, and if so, if you’re using AWS Certificate Manager (ACM) or a third-party certificate authority.

Default

ViewerCertificate.fromCloudFrontDefaultCertificate()

See

https://aws.amazon.com/premiumsupport/knowledge-center/custom-ssl-certificate-cloudfront/

Stability

experimental

Return type

Optional[ViewerCertificate]

viewer_protocol_policy

(experimental) The default viewer policy for incoming clients.

Default

RedirectToHTTPs

Stability

experimental

Return type

Optional[ViewerProtocolPolicy]

web_acl_id

(experimental) Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution.

To specify a web ACL created using the latest version of AWS WAF, use the ACL ARN, for example arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a.

To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example 473e64fd-f30b-4765-81a0-62ad96dd167a.

Default
  • No AWS Web Application Firewall web access control list (web ACL).

See

https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_CreateDistribution.html#API_CreateDistribution_RequestParameters.

Stability

experimental

Return type

Optional[str]