CfnDistributionProps

class aws_cdk.aws_cloudfront.CfnDistributionProps(*, distribution_config, tags=None)

Bases: object

Properties for defining a CfnDistribution.

Parameters:
  • distribution_config (Union[IResolvable, DistributionConfigProperty, Dict[str, Any]]) – The distribution’s configuration.

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – A complex type that contains zero or more Tag elements.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudfront as cloudfront

cfn_distribution_props = cloudfront.CfnDistributionProps(
    distribution_config=cloudfront.CfnDistribution.DistributionConfigProperty(
        default_cache_behavior=cloudfront.CfnDistribution.DefaultCacheBehaviorProperty(
            target_origin_id="targetOriginId",
            viewer_protocol_policy="viewerProtocolPolicy",

            # the properties below are optional
            allowed_methods=["allowedMethods"],
            cached_methods=["cachedMethods"],
            cache_policy_id="cachePolicyId",
            compress=False,
            default_ttl=123,
            field_level_encryption_id="fieldLevelEncryptionId",
            forwarded_values=cloudfront.CfnDistribution.ForwardedValuesProperty(
                query_string=False,

                # the properties below are optional
                cookies=cloudfront.CfnDistribution.CookiesProperty(
                    forward="forward",

                    # the properties below are optional
                    whitelisted_names=["whitelistedNames"]
                ),
                headers=["headers"],
                query_string_cache_keys=["queryStringCacheKeys"]
            ),
            function_associations=[cloudfront.CfnDistribution.FunctionAssociationProperty(
                event_type="eventType",
                function_arn="functionArn"
            )],
            lambda_function_associations=[cloudfront.CfnDistribution.LambdaFunctionAssociationProperty(
                event_type="eventType",
                include_body=False,
                lambda_function_arn="lambdaFunctionArn"
            )],
            max_ttl=123,
            min_ttl=123,
            origin_request_policy_id="originRequestPolicyId",
            realtime_log_config_arn="realtimeLogConfigArn",
            response_headers_policy_id="responseHeadersPolicyId",
            smooth_streaming=False,
            trusted_key_groups=["trustedKeyGroups"],
            trusted_signers=["trustedSigners"]
        ),
        enabled=False,

        # the properties below are optional
        aliases=["aliases"],
        cache_behaviors=[cloudfront.CfnDistribution.CacheBehaviorProperty(
            path_pattern="pathPattern",
            target_origin_id="targetOriginId",
            viewer_protocol_policy="viewerProtocolPolicy",

            # the properties below are optional
            allowed_methods=["allowedMethods"],
            cached_methods=["cachedMethods"],
            cache_policy_id="cachePolicyId",
            compress=False,
            default_ttl=123,
            field_level_encryption_id="fieldLevelEncryptionId",
            forwarded_values=cloudfront.CfnDistribution.ForwardedValuesProperty(
                query_string=False,

                # the properties below are optional
                cookies=cloudfront.CfnDistribution.CookiesProperty(
                    forward="forward",

                    # the properties below are optional
                    whitelisted_names=["whitelistedNames"]
                ),
                headers=["headers"],
                query_string_cache_keys=["queryStringCacheKeys"]
            ),
            function_associations=[cloudfront.CfnDistribution.FunctionAssociationProperty(
                event_type="eventType",
                function_arn="functionArn"
            )],
            lambda_function_associations=[cloudfront.CfnDistribution.LambdaFunctionAssociationProperty(
                event_type="eventType",
                include_body=False,
                lambda_function_arn="lambdaFunctionArn"
            )],
            max_ttl=123,
            min_ttl=123,
            origin_request_policy_id="originRequestPolicyId",
            realtime_log_config_arn="realtimeLogConfigArn",
            response_headers_policy_id="responseHeadersPolicyId",
            smooth_streaming=False,
            trusted_key_groups=["trustedKeyGroups"],
            trusted_signers=["trustedSigners"]
        )],
        cnam_es=["cnamEs"],
        comment="comment",
        continuous_deployment_policy_id="continuousDeploymentPolicyId",
        custom_error_responses=[cloudfront.CfnDistribution.CustomErrorResponseProperty(
            error_code=123,

            # the properties below are optional
            error_caching_min_ttl=123,
            response_code=123,
            response_page_path="responsePagePath"
        )],
        custom_origin=cloudfront.CfnDistribution.LegacyCustomOriginProperty(
            dns_name="dnsName",
            origin_protocol_policy="originProtocolPolicy",
            origin_ssl_protocols=["originSslProtocols"],

            # the properties below are optional
            http_port=123,
            https_port=123
        ),
        default_root_object="defaultRootObject",
        http_version="httpVersion",
        ipv6_enabled=False,
        logging=cloudfront.CfnDistribution.LoggingProperty(
            bucket="bucket",

            # the properties below are optional
            include_cookies=False,
            prefix="prefix"
        ),
        origin_groups=cloudfront.CfnDistribution.OriginGroupsProperty(
            quantity=123,

            # the properties below are optional
            items=[cloudfront.CfnDistribution.OriginGroupProperty(
                failover_criteria=cloudfront.CfnDistribution.OriginGroupFailoverCriteriaProperty(
                    status_codes=cloudfront.CfnDistribution.StatusCodesProperty(
                        items=[123],
                        quantity=123
                    )
                ),
                id="id",
                members=cloudfront.CfnDistribution.OriginGroupMembersProperty(
                    items=[cloudfront.CfnDistribution.OriginGroupMemberProperty(
                        origin_id="originId"
                    )],
                    quantity=123
                )
            )]
        ),
        origins=[cloudfront.CfnDistribution.OriginProperty(
            domain_name="domainName",
            id="id",

            # the properties below are optional
            connection_attempts=123,
            connection_timeout=123,
            custom_origin_config=cloudfront.CfnDistribution.CustomOriginConfigProperty(
                origin_protocol_policy="originProtocolPolicy",

                # the properties below are optional
                http_port=123,
                https_port=123,
                origin_keepalive_timeout=123,
                origin_read_timeout=123,
                origin_ssl_protocols=["originSslProtocols"]
            ),
            origin_access_control_id="originAccessControlId",
            origin_custom_headers=[cloudfront.CfnDistribution.OriginCustomHeaderProperty(
                header_name="headerName",
                header_value="headerValue"
            )],
            origin_path="originPath",
            origin_shield=cloudfront.CfnDistribution.OriginShieldProperty(
                enabled=False,
                origin_shield_region="originShieldRegion"
            ),
            s3_origin_config=cloudfront.CfnDistribution.S3OriginConfigProperty(
                origin_access_identity="originAccessIdentity"
            )
        )],
        price_class="priceClass",
        restrictions=cloudfront.CfnDistribution.RestrictionsProperty(
            geo_restriction=cloudfront.CfnDistribution.GeoRestrictionProperty(
                restriction_type="restrictionType",

                # the properties below are optional
                locations=["locations"]
            )
        ),
        s3_origin=cloudfront.CfnDistribution.LegacyS3OriginProperty(
            dns_name="dnsName",

            # the properties below are optional
            origin_access_identity="originAccessIdentity"
        ),
        staging=False,
        viewer_certificate=cloudfront.CfnDistribution.ViewerCertificateProperty(
            acm_certificate_arn="acmCertificateArn",
            cloud_front_default_certificate=False,
            iam_certificate_id="iamCertificateId",
            minimum_protocol_version="minimumProtocolVersion",
            ssl_support_method="sslSupportMethod"
        ),
        web_acl_id="webAclId"
    ),

    # the properties below are optional
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Attributes

distribution_config

The distribution’s configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html#cfn-cloudfront-distribution-distributionconfig

tags

A complex type that contains zero or more Tag elements.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html#cfn-cloudfront-distribution-tags