CloudFrontDistributionSchema
Hierarchy
- BaseResourceSchema
- CloudFrontDistributionSchema
Index
Properties
inheritedlocalResourceId
The ID the resource was created with, unique within its scope.
inheritedparents
The resources this one is built on top of.
properties
Input properties.
properties.aliases- The custom domain names the distribution answers on, e.g.www.example.com, or*.example.comfor every host underexample.com. Each one needs a DNS record pointing at the distribution, which this resource does not create. Empty serves only the*.cloudfront.netdomain CloudFront assigns.properties.awsAccountId- The AWS account id.properties.behaviors- The routing table. Exactly one entry has nopathPatternand is the default behavior; the rest are matched in order before it. See CloudFrontBehaviorSchema.properties.cachePolicies- Cache policies this distribution declares. See CloudFrontCachePolicySchema.properties.comment- A human-readable label, at most 128 characters. It is the only name a distribution carries in the console.properties.customErrorResponses- What the viewer gets for an origin error. See CloudFrontCustomErrorResponseSchema.properties.defaultRootObject- The object served for a request to the site root, e.g.index.htmlordocs/index.html, never starting with/. Empty passes the request to the origin as it is.properties.distributionName- What names this distribution. Part of its identity.properties.enabled- Whether the distribution serves traffic. Disabling is also the first half of deleting one, which AWS makes a slow operation.properties.geoRestriction- Which countries may reach the distribution, each an uppercase two-letter ISO 3166-1 code, e.g.DE.properties.httpVersion- See ICloudFrontHttpVersion.properties.originGroups- Fail-over pairs over the origins. See CloudFrontOriginGroupSchema.properties.originRequestPolicies- Origin request policies this distribution declares. See CloudFrontOriginRequestPolicySchema.properties.origins- Where content comes from. See CloudFrontOriginSchema.properties.priceClass- See ICloudFrontPriceClass.properties.responseHeadersPolicies- Response headers policies this distribution declares. See CloudFrontResponseHeadersPolicySchema.properties.viewerCertificate- The certificate viewers see.defaultserves CloudFront's own, which is valid only for the assigned*.cloudfront.netdomain;acmserves a certificate of yours, which CloudFront reads fromus-east-1alone. See ICloudFrontMinimumProtocolVersion.
Type declaration
aliases: string[]
awsAccountId: string
behaviors: CloudFrontBehaviorSchema[]
cachePolicies: CloudFrontCachePolicySchema[]
comment: string
customErrorResponses: CloudFrontCustomErrorResponseSchema[]
defaultRootObject: string
distributionName: string
enabled: boolean
geoRestriction: { countries: string[]; kind: allow | block } | { kind: none }
httpVersion: http1.1 | http2 | http2and3
originGroups: CloudFrontOriginGroupSchema[]
originRequestPolicies: CloudFrontOriginRequestPolicySchema[]
origins: CloudFrontOriginSchema[]
priceClass: PriceClass_100 | PriceClass_200 | PriceClass_All
responseHeadersPolicies: CloudFrontResponseHeadersPolicySchema[]
viewerCertificate: { certificateArn: string; kind: acm; minimumProtocolVersion: TLSv1 | TLSv1.1_2016 | TLSv1.2_2018 | TLSv1.2_2019 | TLSv1.2_2021 | TLSv1.2_2025 | TLSv1.3_2025 | TLSv1_2016 } | { kind: default }
inheritedresourceId
The ID of the resource, unique across the infrastructure: its localResourceId, followed by a hash
of its scope when it has one.
response
Saved response.
response.Arn- The ARN of the distribution. A bucket admitting this distribution names it.response.DistributionId- The distribution id, which is what an invalidation is issued against.response.DomainName- The*.cloudfront.netdomain CloudFront assigned. Point a DNS record at this.response.HostedZoneId- The zone a Route 53 alias record pointing at this distribution needs.
Type declaration
optionalArn?: string
optionalDistributionId?: string
optionalDomainName?: string
optionalHostedZoneId?: string
inheritedscope
The contexts of the models the resource is placed under, derived from where the node creating it sits in the model graph. Octo sets it; a resource created outside a model action has none.
inheritedtags
The tags applied to the resource.
Type declaration
[key string]: string
The
CloudFrontDistributionSchemaclass is the schema for theCloudFrontDistributionresource, which represents an AWS CloudFront distribution. Terraform provisions it asaws_cloudfront_distribution, alongside anaws_cloudfront_origin_access_controlper S3 origin and one terraform resource per policy the distribution declares.Resources/CloudFrontDistribution
parents - The Lambda functions and ALBs it serves, each attached after construction, with
addLambdaOrigin()andaddAlbOrigin(). An S3 bucket is a child of the distribution instead.resourceId - The resource id is of format
cloudfront-<distribution-name>.