Skip to content

dfds/aws-modules-cloudfront

Repository files navigation

aws-modules-cloudfront

Module for AWS Cloudfront distribution

Documentation

Requirements

Name Version
terraform >= 1.0.0
aws >= 4.50.0

Providers

Name Version
aws >= 4.50.0

Modules

No modules.

Resources

Name Type
aws_cloudfront_distribution.this resource

Inputs

Name Description Type Default Required
aliases List of extra CNAMEs (alternate domain names), if any, for this distribution list(string) [] no
allowed_methods Controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin list(string) n/a yes
cache_policy_id The unique identifier of the cache policy that is attached to the cache behavior string "" no
cached_methods Controls whether CloudFront caches the response to requests using the specified HTTP methods list(string) n/a yes
comment Any comments you want to include about the distribution string "" no
compress Whether you want CloudFront to automatically compress content for web requests that include Accept-Encoding: gzip in the request header bool false no
custom_error_response One or more custom error response elements (multiples allowed)
list(object({
error_code = string
error_caching_min_ttl = number
response_code = string
response_page_path = string
}))
[] no
default_root_object The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL string "" no
default_ttl n/a number 3600 no
enabled Whether the distribution is enabled to accept end user requests for content bool true no
field_level_encryption_id Field level encryption configuration ID string "" no
forwarded_values The forwarded values configuration that specifies how CloudFront handles query strings, cookies and headers (maximum one)
object({
query_string = bool
headers = optional(list(string))
query_string_cache_keys = optional(list(string))
cookies = object({
forward = string
whitelisted_names = optional(list(string))
})
})
{
"cookies": {
"forward": "none"
},
"query_string": false
}
no
function_association A config block that triggers a cloudfront function with specific actions (maximum 2)
list(object({
event_type = string
lambda_arn = string
}))
[] no
http_version The maximum HTTP version to support on the distribution string "http2" no
is_ipv6_enabled Whether the IPv6 is enabled for the distribution bool false no
lambda_function_association A config block that triggers a lambda function with specific actions (maximum 4)
list(object({
event_type = string
lambda_arn = string
include_body = optional(bool)
}))
[] no
logging_config The logging configuration that controls how logs are written to your distribution (maximum one)
object({
bucket = string
include_cookies = optional(bool)
prefix = optional(string)
})
{
"bucket": null
}
no
max_ttl The maximum amount of time (in seconds) that an object is in a CloudFront cache before CloudFront forwards another request to your origin to determine whether the object has been updated. Only effective in the presence of Cache-Control max-age, Cache-Control s-maxage, and Expires headers. number 86400 no
min_ttl The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront queries your origin to see whether the object has been updated number 0 no
ordered_cache_behavior 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 list(any) [] no
origin One or more origins for this distribution (multiples allowed)
list(object({
domain_name = string
origin_id = string
connection_attempts = optional(number)
connection_timeout = optional(number)
custom_header = optional(list(object({
name = optional(string)
value = optional(string)
})))
custom_origin_config = optional(object({
http_port = optional(number)
https_port = optional(number)
origin_protocol_policy = optional(string)
origin_ssl_protocols = optional(string)
origin_keepalive_timeout = optional(number)
origin_read_timeout = optional(number)
}))
origin_access_control_id = optional(string)
origin_path = optional(string)
origin_shield = optional(object({
enabled = optional(bool)
origin_shield_region = optional(string)
}))
s3_origin_config = optional(object({
origin_access_identity = string
}))
}))
n/a yes
origin_group One or more origin_group for this distribution (multiples allowed)
list(object({
origin_id = string
failover_criteria = object({
status_codes = list(number)
})
member = list(object({
origin_id = string
}))
}))
[] no
price_class The price class for this distribution string "PriceClass_100" no
realtime_log_config_arn The ARN of the real-time log configuration that is attached to this cache behavior string "" no
response_headers_policy_id The identifier for a response headers policy string "" no
restrictions The restriction configuration for this distribution (maximum one)
object({
geo_restriction = object({
locations = list(string)
restriction_type = string
})
})
n/a yes
retain_on_delete Disables the distribution instead of deleting it when destroying the resource through Terraform. If this is set, the distribution needs to be deleted manually afterwards bool false no
tags Tags for the CloudFront distribution object({}) {} no
target_origin_id The value of ID for the origin that you want CloudFront to route requests to when a request matches the path pattern either for a cache behavior or for the default cache behavior string n/a yes
trusted_key_groups A list of key group IDs that CloudFront can use to validate signed URLs or signed cookies list(string) [] no
trusted_signers List of AWS account IDs (or self) that you want to allow to create signed URLs for private content list(string) [] no
viewer_certificate The SSL configuration for this distribution (maximum one).
object({
acm_certificate_arn = optional(string)
cloudfront_default_certificate = optional(bool)
iam_certificate_id = optional(string)
minimum_protocol_version = optional(string)
ssl_support_method = optional(string)
})
{} no
viewer_protocol_policy Use this element to specify the protocol that users can use to access the files in the origin specified by TargetOriginId when a request matches the path pattern in PathPattern string n/a yes
wait_for_deployment If enabled, the resource will wait for the distribution status to change from InProgress to Deployed. Setting this to false will skip the process bool true no
web_acl_id A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution string "" no

Outputs

Name Description
cloudfront_arn ARN of the cloudfront distribution
domain_name Domain name

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages