Skip to content

AWS::CloudFront::Distribution

A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.

Generated by cfn-typegen --out cfn_types AWS::CloudFront::Distribution into cfn_types/cloudfront.py:

# Generated by cfn-typegen from the CloudFormation registry schemas. Do not edit.
# fmt: off
# ruff: noqa
"""AWS::CloudFront resources."""

from collections.abc import Sequence
from typing import Any, Literal, NotRequired, Unpack
from typing_extensions import TypedDict
from cfn_typed.base import DeletionPolicy, DependsOn, ResourceAttrs, Tag, UpdateReplacePolicy, build
from cfn_typed.intrinsics import Expr


CONSTRAINTS:dict[str,Any]={
'AWS::CloudFront::Distribution':{'DistributionConfig':{'P':{'ConnectionMode':{'e':["direct","tenant-only"]},'OriginGroups':{'P':{'Items':{'T':{'P':{'SelectionCriteria':{'e':["default","media-quality-based"]}}}}}},'Origins':{'T':{'P':{'CustomOriginConfig':{'P':{'IpAddressType':{'e':["ipv4","ipv6","dualstack"]}}}}}},'ViewerMtlsConfig':{'P':{'Mode':{'e':["required","optional","passthrough"]}}}}}},
}


ATTRIBUTES:dict[str,Any]={"AWS::CloudFront::Distribution":["DomainName","Id"]}


RULES:dict[str,Any]={}
Nested types (39)

These are defined above the properties in the generated module.

class DistributionCookies(TypedDict, closed=True):
    'This field is deprecated.'
    Forward: Expr[str]
    'This field is deprecated.'
    WhitelistedNames: NotRequired[Expr[list[Expr[str]]]]
    'This field is deprecated.'


class DistributionForwardedValues(TypedDict, closed=True):
    'This field only supports standard distributions.'
    Cookies: NotRequired[Expr[DistributionCookies]]
    'This field is deprecated.'
    Headers: NotRequired[Expr[list[Expr[str]]]]
    'This field is deprecated.'
    QueryString: Expr[bool]
    'This field is deprecated.'
    QueryStringCacheKeys: NotRequired[Expr[list[Expr[str]]]]
    'This field is deprecated.'


class DistributionFunctionAssociation(TypedDict, closed=True):
    'A CloudFront function that is associated with a cache behavior in a CloudFront distribution.'
    EventType: NotRequired[Expr[str]]
    'The event type of the function, either ``viewer-request`` or ``viewer-response``.'
    FunctionARN: NotRequired[Expr[str]]
    'The Amazon Resource Name (ARN) of the function.'


class DistributionGrpcConfig(TypedDict, closed=True):
    'Amazon CloudFront supports gRPC, an open-source remote procedure call (RPC) framework built on HTTP/2.'
    Enabled: Expr[bool]
    'Enables your CloudFront distribution to receive gRPC requests and to proxy them directly to your origins.'


class DistributionLambdaFunctionAssociation(TypedDict, closed=True):
    'A complex type that contains a Lambda@Edge function association.'
    EventType: NotRequired[Expr[str]]
    'Specifies the event type that triggers a Lambda@Edge function invocation.'
    IncludeBody: NotRequired[Expr[bool]]
    'A flag that allows a Lambda@Edge function to have read access to the body content.'
    LambdaFunctionARN: NotRequired[Expr[str]]
    'The ARN of the Lambda@Edge function.'


class DistributionCacheBehavior(TypedDict, closed=True):
    'A complex type that describes how CloudFront processes requests.'
    AllowedMethods: NotRequired[Expr[list[Expr[str]]]]
    'A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin.'
    CachePolicyId: NotRequired[Expr[str]]
    'The unique identifier of the cache policy that is attached to this cache behavior.'
    CachedMethods: NotRequired[Expr[list[Expr[str]]]]
    'A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods.'
    Compress: NotRequired[Expr[bool]]
    'Whether you want CloudFront to automatically compress certain files for this cache behavior.'
    DefaultTTL: NotRequired[Expr[float]]
    'This field only supports standard distributions.'
    FieldLevelEncryptionId: NotRequired[Expr[str]]
    'The value of ``ID`` for the field-level encryption configuration that you want CloudFront to use for encrypting specific fields of data for this cache behavior.'
    ForwardedValues: NotRequired[Expr[DistributionForwardedValues]]
    'This field is deprecated.'
    FunctionAssociations: NotRequired[Expr[Sequence[Expr[DistributionFunctionAssociation]]]]
    'A list of CloudFront functions that are associated with this cache behavior.'
    GrpcConfig: NotRequired[Expr[DistributionGrpcConfig]]
    'The gRPC configuration for your cache behavior.'
    LambdaFunctionAssociations: NotRequired[Expr[Sequence[Expr[DistributionLambdaFunctionAssociation]]]]
    'A complex type that contains zero or more Lambda@Edge function associations for a cache behavior.'
    MaxTTL: NotRequired[Expr[float]]
    'This field only supports standard distributions.'
    MinTTL: NotRequired[Expr[float]]
    'This field only supports standard distributions.'
    OriginRequestPolicyId: NotRequired[Expr[str]]
    'The unique identifier of the origin request policy that is attached to this cache behavior.'
    PathPattern: Expr[str]
    'The pattern (for example, ``images/*.jpg``) that specifies which requests to apply the behavior to.'
    RealtimeLogConfigArn: NotRequired[Expr[str]]
    'The Amazon Resource Name (ARN) of the real-time log configuration that is attached to this cache behavior.'
    ResponseHeadersPolicyId: NotRequired[Expr[str]]
    'The identifier for a response headers policy.'
    SmoothStreaming: NotRequired[Expr[bool]]
    'This field only supports standard distributions.'
    TargetOriginId: Expr[str]
    'The value of ``ID`` for the origin that you want CloudFront to route requests to when they match this cache behavior.'
    TrustedKeyGroups: NotRequired[Expr[list[Expr[str]]]]
    'A list of key groups that CloudFront can use to validate signed URLs or signed cookies.'
    TrustedSigners: NotRequired[Expr[list[Expr[str]]]]
    'We recommend using ``TrustedKeyGroups`` instead of ``TrustedSigners``.'
    ViewerProtocolPolicy: Expr[str]
    'The protocol that viewers can use to access the files in the origin specified by ``TargetOriginId`` when a request matches the path pattern in ``PathPattern``.'


class DistributionConnectionFunctionAssociation(TypedDict, closed=True):
    'A connection function association.'
    Id: Expr[str]
    "The association's ID."


class DistributionCustomErrorResponse(TypedDict, closed=True):
    'A complex type that controls: + Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the respon...'
    ErrorCachingMinTTL: NotRequired[Expr[float]]
    'The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ``ErrorCode``.'
    ErrorCode: Expr[int]
    'The HTTP status code for which you want to specify a custom error page and/or a caching duration.'
    ResponseCode: NotRequired[Expr[int]]
    'The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.'
    ResponsePagePath: NotRequired[Expr[str]]
    'The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the HTTP status code specified by ``ErrorCode``, fo...'


class DistributionLegacyCustomOrigin(TypedDict, closed=True):
    'A custom origin.'
    DNSName: Expr[str]
    'The domain name assigned to your CF distribution.'
    HTTPPort: NotRequired[Expr[int]]
    'The HTTP port that CF uses to connect to the origin.'
    HTTPSPort: NotRequired[Expr[int]]
    'The HTTPS port that CF uses to connect to the origin.'
    OriginProtocolPolicy: Expr[str]
    'Specifies the protocol (HTTP or HTTPS) that CF uses to connect to the origin.'
    OriginSSLProtocols: Expr[list[Expr[str]]]
    'The minimum SSL/TLS protocol version that CF uses when communicating with your origin server over HTTPs.'


class DistributionDefaultCacheBehavior(TypedDict, closed=True):
    "A complex type that describes the default cache behavior if you don't specify a ``CacheBehavior`` element or if request URLs don't match any of the values of..."
    AllowedMethods: NotRequired[Expr[list[Expr[str]]]]
    'A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin.'
    CachePolicyId: NotRequired[Expr[str]]
    'The unique identifier of the cache policy that is attached to the default cache behavior.'
    CachedMethods: NotRequired[Expr[list[Expr[str]]]]
    'A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods.'
    Compress: NotRequired[Expr[bool]]
    'Whether you want CloudFront to automatically compress certain files for this cache behavior.'
    DefaultTTL: NotRequired[Expr[float]]
    'This field only supports standard distributions.'
    FieldLevelEncryptionId: NotRequired[Expr[str]]
    'The value of ``ID`` for the field-level encryption configuration that you want CloudFront to use for encrypting specific fields of data for the default cache...'
    ForwardedValues: NotRequired[Expr[DistributionForwardedValues]]
    'This field is deprecated.'
    FunctionAssociations: NotRequired[Expr[Sequence[Expr[DistributionFunctionAssociation]]]]
    'A list of CloudFront functions that are associated with this cache behavior.'
    GrpcConfig: NotRequired[Expr[DistributionGrpcConfig]]
    'The gRPC configuration for your cache behavior.'
    LambdaFunctionAssociations: NotRequired[Expr[Sequence[Expr[DistributionLambdaFunctionAssociation]]]]
    'A complex type that contains zero or more Lambda@Edge function associations for a cache behavior.'
    MaxTTL: NotRequired[Expr[float]]
    'This field only supports standard distributions.'
    MinTTL: NotRequired[Expr[float]]
    'This field only supports standard distributions.'
    OriginRequestPolicyId: NotRequired[Expr[str]]
    'The unique identifier of the origin request policy that is attached to the default cache behavior.'
    RealtimeLogConfigArn: NotRequired[Expr[str]]
    'The Amazon Resource Name (ARN) of the real-time log configuration that is attached to this cache behavior.'
    ResponseHeadersPolicyId: NotRequired[Expr[str]]
    'The identifier for a response headers policy.'
    SmoothStreaming: NotRequired[Expr[bool]]
    'This field only supports standard distributions.'
    TargetOriginId: Expr[str]
    'The value of ``ID`` for the origin that you want CloudFront to route requests to when they use the default cache behavior.'
    TrustedKeyGroups: NotRequired[Expr[list[Expr[str]]]]
    'A list of key groups that CloudFront can use to validate signed URLs or signed cookies.'
    TrustedSigners: NotRequired[Expr[list[Expr[str]]]]
    'We recommend using ``TrustedKeyGroups`` instead of ``TrustedSigners``.'
    ViewerProtocolPolicy: Expr[str]
    'The protocol that viewers can use to access the files in the origin specified by ``TargetOriginId`` when a request matches the path pattern in ``PathPattern``.'


class DistributionLogging(TypedDict, closed=True):
    'A complex type that specifies whether access logs are written for the distribution.'
    Bucket: NotRequired[Expr[str]]
    'The Amazon S3 bucket to store the access logs in, for example, ``amzn-s3-demo-bucket.s3.amazonaws.com``.'
    IncludeCookies: NotRequired[Expr[bool]]
    'Specifies whether you want CloudFront to include cookies in access logs, specify ``true`` for ``IncludeCookies``.'
    Prefix: NotRequired[Expr[str]]
    'An optional string that you want CloudFront to prefix to the access log ``filenames`` for this distribution, for example, ``myprefix/``.'


class DistributionStatusCodes(TypedDict, closed=True):
    'A complex data type for the status codes that you specify that, when returned by a primary origin, trigger CloudFront to failover to a second origin.'
    Items: Expr[Sequence[Expr[int]]]
    'The items (status codes) for an origin group.'
    Quantity: Expr[int]
    'The number of status codes.'


class DistributionOriginGroupFailoverCriteria(TypedDict, closed=True):
    'A complex data type that includes information about the failover criteria for an origin group, including the status codes for which CloudFront will failover ...'
    StatusCodes: Expr[DistributionStatusCodes]
    'The status codes that, when returned from the primary origin, will trigger CloudFront to failover to the second origin.'


class DistributionOriginGroupMember(TypedDict, closed=True):
    'An origin in an origin group.'
    OriginId: Expr[str]
    'The ID for an origin in an origin group.'


class DistributionOriginGroupMembers(TypedDict, closed=True):
    'A complex data type for the origins included in an origin group.'
    Items: Expr[Sequence[Expr[DistributionOriginGroupMember]]]
    'Items (origins) in an origin group.'
    Quantity: Expr[int]
    'The number of origins in an origin group.'


class DistributionOriginGroup(TypedDict, closed=True):
    'An origin group includes two origins (a primary origin and a secondary origin to failover to) and a failover criteria that you specify.'
    FailoverCriteria: Expr[DistributionOriginGroupFailoverCriteria]
    'A complex type that contains information about the failover criteria for an origin group.'
    Id: Expr[str]
    "The origin group's ID."
    Members: Expr[DistributionOriginGroupMembers]
    'A complex type that contains information about the origins in an origin group.'
    SelectionCriteria: NotRequired[Expr[str]]
    'The selection criteria for the origin group.'


class DistributionOriginGroups(TypedDict, closed=True):
    'A complex data type for the origin groups specified for a distribution.'
    Items: NotRequired[Expr[Sequence[Expr[DistributionOriginGroup]]]]
    'The items (origin groups) in a distribution.'
    Quantity: Expr[int]
    'The number of origin groups.'


class DistributionOriginMtlsConfig(TypedDict, closed=True):
    'Configures mutual TLS authentication between CloudFront and your origin server.'
    ClientCertificateArn: Expr[str]
    'The Amazon Resource Name (ARN) of the client certificate stored in AWS Certificate Manager (ACM) that CloudFront uses to authenticate with your origin using ...'


class DistributionCustomOriginConfig(TypedDict, closed=True):
    'A custom origin.'
    HTTPPort: NotRequired[Expr[int]]
    'The HTTP port that CloudFront uses to connect to the origin.'
    HTTPSPort: NotRequired[Expr[int]]
    'The HTTPS port that CloudFront uses to connect to the origin.'
    OriginKeepaliveTimeout: NotRequired[Expr[int]]
    'Specifies how long, in seconds, CloudFront persists its connection to the origin.'
    OriginProtocolPolicy: Expr[str]
    'Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to the origin.'
    OriginReadTimeout: NotRequired[Expr[int]]
    'Specifies how long, in seconds, CloudFront waits for a response from the origin.'
    OriginSSLProtocols: NotRequired[Expr[list[Expr[str]]]]
    'Specifies the minimum SSL/TLS protocol that CloudFront uses when connecting to your origin over HTTPS.'
    IpAddressType: NotRequired[Expr[str]]
    'Specifies which IP protocol CloudFront uses when connecting to your origin.'
    OriginMtlsConfig: NotRequired[Expr[DistributionOriginMtlsConfig]]
    'Configures mutual TLS authentication between CloudFront and your origin server.'


class DistributionOriginCustomHeader(TypedDict, closed=True):
    'A complex type that contains ``HeaderName`` and ``HeaderValue`` elements, if any, for this distribution.'
    HeaderName: Expr[str]
    'The name of a header that you want CloudFront to send to your origin.'
    HeaderValue: Expr[str]
    'The value for the header that you specified in the ``HeaderName`` field.'


class DistributionOriginShield(TypedDict, closed=True):
    'CloudFront Origin Shield.'
    Enabled: NotRequired[Expr[bool]]
    'A flag that specifies whether Origin Shield is enabled.'
    OriginShieldRegion: NotRequired[Expr[str]]
    'The AWS-Region for Origin Shield.'


class DistributionS3OriginConfig(TypedDict, closed=True):
    'A complex type that contains information about the Amazon S3 origin.'
    OriginAccessIdentity: NotRequired[Expr[str]]
    "If you're using origin access control (OAC) instead of origin access identity, specify an empty ``OriginAccessIdentity`` element."
    OriginReadTimeout: NotRequired[Expr[int]]
    'Specifies how long, in seconds, CloudFront waits for a response from the origin.'


class DistributionVpcOriginConfig(TypedDict, closed=True):
    'An Amazon CloudFront VPC origin configuration.'
    OriginKeepaliveTimeout: NotRequired[Expr[int]]
    'Specifies how long, in seconds, CloudFront persists its connection to the origin.'
    OriginReadTimeout: NotRequired[Expr[int]]
    'Specifies how long, in seconds, CloudFront waits for a response from the origin.'
    OwnerAccountId: NotRequired[Expr[str]]
    'The account ID of the AWS-account that owns the VPC origin.'
    VpcOriginId: Expr[str]
    'The VPC origin ID.'


class DistributionOrigin(TypedDict, closed=True):
    'An origin.'
    ConnectionAttempts: NotRequired[Expr[int]]
    'The number of times that CloudFront attempts to connect to the origin.'
    ConnectionTimeout: NotRequired[Expr[int]]
    'The number of seconds that CloudFront waits when trying to establish a connection to the origin.'
    ResponseCompletionTimeout: NotRequired[Expr[int]]
    'The time (in seconds) that a request from CloudFront to the origin can stay open and wait for a response.'
    CustomOriginConfig: NotRequired[Expr[DistributionCustomOriginConfig]]
    'Use this type to specify an origin that is not an Amazon S3 bucket, with one exception.'
    DomainName: Expr[str]
    'The domain name for the origin.'
    Id: Expr[str]
    'A unique identifier for the origin.'
    OriginAccessControlId: NotRequired[Expr[str]]
    'The unique identifier of an origin access control for this origin.'
    OriginCustomHeaders: NotRequired[Expr[Sequence[Expr[DistributionOriginCustomHeader]]]]
    'A list of HTTP header names and values that CloudFront adds to the requests that it sends to the origin.'
    OriginPath: NotRequired[Expr[str]]
    'An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin.'
    OriginShield: NotRequired[Expr[DistributionOriginShield]]
    'CloudFront Origin Shield.'
    S3OriginConfig: NotRequired[Expr[DistributionS3OriginConfig]]
    'Use this type to specify an origin that is an Amazon S3 bucket that is not configured with static website hosting.'
    VpcOriginConfig: NotRequired[Expr[DistributionVpcOriginConfig]]
    'The VPC origin configuration.'


class DistributionGeoRestriction(TypedDict, closed=True):
    'A complex type that controls the countries in which your content is distributed.'
    Locations: NotRequired[Expr[list[Expr[str]]]]
    'A complex type that contains a ``Location`` element for each country in which you want CloudFront either to distribute your content (``whitelist``) or not di...'
    RestrictionType: Expr[str]
    'The method that you want to use to restrict distribution of your content by country: + ``none``: No geo restriction is enabled, meaning access to content is ...'


class DistributionRestrictions(TypedDict, closed=True):
    'A complex type that identifies ways in which you want to restrict distribution of your content.'
    GeoRestriction: Expr[DistributionGeoRestriction]
    'A complex type that controls the countries in which your content is distributed.'


class DistributionLegacyS3Origin(TypedDict, closed=True):
    'The origin as an S3 bucket.'
    DNSName: Expr[str]
    'The domain name assigned to your CF distribution.'
    OriginAccessIdentity: NotRequired[Expr[str]]
    'The CF origin access identity to associate with the distribution.'


class DistributionParameterDefinitionDefinitionStringSchema(TypedDict, closed=True):
    Comment: NotRequired[Expr[str]]
    DefaultValue: NotRequired[Expr[str]]
    Required: Expr[bool]


class DistributionParameterDefinitionDefinition(TypedDict, closed=True):
    'The value that you assigned to the parameter.'
    StringSchema: NotRequired[Expr[DistributionParameterDefinitionDefinitionStringSchema]]


class DistributionParameterDefinition(TypedDict, closed=True):
    'A list of parameter values to add to the resource.'
    Name: Expr[str]
    'The name of the parameter.'
    Definition: Expr[DistributionParameterDefinitionDefinition]
    'The value that you assigned to the parameter.'


class DistributionDistributionConfigTenantConfig(TypedDict, closed=True):
    'This field only supports multi-tenant distributions.'
    ParameterDefinitions: NotRequired[Expr[Sequence[Expr[DistributionParameterDefinition]]]]


class DistributionCacheTagConfig(TypedDict, closed=True):
    'A complex type that specifies the HTTP header name from which CloudFront extracts cache tags from origin responses.'
    HeaderName: Expr[str]
    'The name of the HTTP header that your origin includes in responses.'


class DistributionTrustStoreConfig(TypedDict, closed=True):
    'A trust store configuration.'
    TrustStoreId: Expr[str]
    'The trust store ID.'
    AdvertiseTrustStoreCaNames: NotRequired[Expr[bool]]
    'The configuration to use to advertise trust store CA names.'
    IgnoreCertificateExpiry: NotRequired[Expr[bool]]
    'The configuration to use to ignore certificate expiration.'


class DistributionViewerMtlsConfig(TypedDict, closed=True):
    'A viewer mTLS configuration.'
    Mode: NotRequired[Expr[str]]
    'The viewer mTLS mode.'
    TrustStoreConfig: NotRequired[Expr[DistributionTrustStoreConfig]]
    'The trust store configuration associated with the viewer mTLS configuration.'


class DistributionViewerCertificate(TypedDict, closed=True):
    "A complex type that determines the distribution's SSL/TLS configuration for communicating with viewers."
    AcmCertificateArn: NotRequired[Expr[str]]
    'In CloudFormation, this field name is ``AcmCertificateArn``.'
    CloudFrontDefaultCertificate: NotRequired[Expr[bool]]
    'If the distribution uses the CloudFront domain name such as ``d111111abcdef8.cloudfront.net``, set this field to ``true``.'
    IamCertificateId: NotRequired[Expr[str]]
    'This field only supports standard distributions.'
    MinimumProtocolVersion: NotRequired[Expr[str]]
    'If the distribution uses ``Aliases`` (alternate domain names or CNAMEs), specify the security policy that you want CloudFront to use for HTTPS connections wi...'
    SslSupportMethod: NotRequired[Expr[str]]
    'In CloudFormation, this field name is ``SslSupportMethod``.'


class DistributionDistributionConfig(TypedDict, closed=True):
    'A distribution configuration.'
    Aliases: NotRequired[Expr[list[Expr[str]]]]
    'This field only supports standard distributions.'
    AnycastIpListId: NotRequired[Expr[str]]
    'To use this field for a multi-tenant distribution, use a connection group instead.'
    CNAMEs: NotRequired[Expr[list[Expr[str]]]]
    "An alias for the CF distribution's domain name."
    CacheBehaviors: NotRequired[Expr[Sequence[Expr[DistributionCacheBehavior]]]]
    'A complex type that contains zero or more ``CacheBehavior`` elements.'
    Comment: NotRequired[Expr[str]]
    'A comment to describe the distribution.'
    ConnectionMode: NotRequired[Expr[str]]
    'This field specifies whether the connection mode is through a standard distribution (direct) or a multi-tenant distribution with distribution tenants (tenant...'
    ConnectionFunctionAssociation: NotRequired[Expr[DistributionConnectionFunctionAssociation]]
    "The distribution's connection function association."
    ContinuousDeploymentPolicyId: NotRequired[Expr[str]]
    'This field only supports standard distributions.'
    CustomErrorResponses: NotRequired[Expr[Sequence[Expr[DistributionCustomErrorResponse]]]]
    'A complex type that controls the following: + Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before return...'
    CustomOrigin: NotRequired[Expr[DistributionLegacyCustomOrigin]]
    'The user-defined HTTP server that serves as the origin for content that CF distributes.'
    DefaultCacheBehavior: Expr[DistributionDefaultCacheBehavior]
    "A complex type that describes the default cache behavior if you don't specify a ``CacheBehavior`` element or if files don't match any of the values of ``Path..."
    DefaultRootObject: NotRequired[Expr[str]]
    'When a viewer requests the root URL for your distribution, the default root object is the object that you want CloudFront to request from your origin.'
    Enabled: Expr[bool]
    'From this field, you can enable or disable the selected distribution.'
    HttpVersion: NotRequired[Expr[str]]
    '(Optional) Specify the HTTP version(s) that you want viewers to use to communicate with CF.'
    IPV6Enabled: NotRequired[Expr[bool]]
    'To use this field for a multi-tenant distribution, use a connection group instead.'
    Logging: NotRequired[Expr[DistributionLogging]]
    'A complex type that controls whether access logs are written for the distribution.'
    OriginGroups: NotRequired[Expr[DistributionOriginGroups]]
    'A complex type that contains information about origin groups for this distribution.'
    Origins: NotRequired[Expr[Sequence[Expr[DistributionOrigin]]]]
    'A complex type that contains information about origins for this distribution.'
    PriceClass: NotRequired[Expr[str]]
    'This field only supports standard distributions.'
    Restrictions: NotRequired[Expr[DistributionRestrictions]]
    'A complex type that identifies ways in which you want to restrict distribution of your content.'
    S3Origin: NotRequired[Expr[DistributionLegacyS3Origin]]
    'The origin as an S3 bucket.'
    Staging: NotRequired[Expr[bool]]
    'This field only supports standard distributions.'
    TenantConfig: NotRequired[Expr[DistributionDistributionConfigTenantConfig]]
    'This field only supports multi-tenant distributions.'
    CacheTagConfig: NotRequired[Expr[DistributionCacheTagConfig]]
    'Configuration for cache tag extraction from origin responses.'
    ViewerMtlsConfig: NotRequired[Expr[DistributionViewerMtlsConfig]]
    "The distribution's viewer mTLS configuration."
    ViewerCertificate: NotRequired[Expr[DistributionViewerCertificate]]
    "A complex type that determines the distribution's SSL/TLS configuration for communicating with viewers."
    WebACLId: NotRequired[Expr[str]]
    'Multi-tenant distributions only support WAF V2 web ACLs.'


class DistributionProps(TypedDict, closed=True):
    'A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.'
    DistributionConfig: Expr[DistributionDistributionConfig]
    "The distribution's configuration."
    Tags: NotRequired[Expr[Sequence[Expr[Tag]]]]
    'A complex type that contains zero or more ``Tag`` elements.'


class Distribution(ResourceAttrs):
    'A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.'
    Type: Literal['AWS::CloudFront::Distribution']
    Properties: DistributionProps


def distribution(
    *,
    depends_on: DependsOn | None = None,
    deletion_policy: DeletionPolicy | None = None,
    update_replace_policy: UpdateReplacePolicy | None = None,
    condition: str | None = None,
    metadata: dict[str, Any] | None = None,
    **props: Unpack[DistributionProps],
) -> Distribution:
    return build('AWS::CloudFront::Distribution', props, depends_on, deletion_policy, update_replace_policy, condition, metadata)

Attributes

Read-only values for get_att(logical_id, attribute). They are not accepted as inputs.

  • DomainName
  • Id