CloudFront
Terraform module to create AWS CloudFront resources
Inputs
40 / 41
default_cache_behaviorrequiredobject({ allowed_methods = optional(list(string), ["GET", "HEAD", "OPTIONS"]) ca…The default cache behavior for this distribution
aliasesoptionallist(string)Extra CNAMEs (alternate domain names), if any, for this distribution
nullanycast_ip_list_idoptionalstringID of the Anycast static IP list that is associated with the distribution
nullcache_policiesoptionalmap(object({ name = optional(string) comment = optional(string) default_ttl = op…Map of CloudFront cache policies
nullcache_tag_configoptionalobject({ header_name = string })Cache tag configuration block for cache tag extraction from origin responses (maximum one). See the [AWS documentation](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/invalidation-by-tags.html) for more information about cache tags
nullcloudfront_functionsoptionalmap(object({ name = optional(string) runtime = optional(string, "cloudfront-js-2…Map of CloudFront Function configurations. Key is used as default function name if 'name' not specified
nullcommentoptionalstringAny comments you want to include about the distribution
nullconnection_function_association_idoptionalstringIdentifier of the connection function to associate with the distribution
nullconnection_function_codeoptionalstringThe code of the CloudFront connection function
nullconnection_function_configoptionalobject({ comment = string runtime = string key_value_store_association = optiona…Configuration block for the CloudFront connection function
nullconnection_function_nameoptionalstringThe name of the CloudFront connection function
nullconnection_function_publishoptionalboolWhether to publish the function to the LIVE stage after creation or update. Defaults to false
nullcontinuous_deployment_policy_idoptionalstringIdentifier of a continuous deployment policy. This argument should only be set on a production distribution
nullcreateoptionalboolControls if resources should be created (affects nearly all resources)
truecreate_connection_functionoptionalboolControls whether to create a CloudFront connection function
falsecreate_monitoring_subscriptionoptionalboolIf enabled, the resource for monitoring subscription will created
falsecustom_error_responseoptionallist(object({ error_caching_min_ttl = optional(number) error_code = number respo…One or more custom error response elements
nulldefault_root_objectoptionalstringThe object that you want CloudFront to return (for example, index.html) when an end user requests the root URL
nullenable_v2_loggingoptionalboolWhether to enable v2 logging for the CloudFront distribution
falseenabledoptionalboolWhether the distribution is enabled to accept end user requests for content
truehttp_versionoptionalstringThe maximum HTTP version to support on the distribution. Allowed values are http1.1, http2, http2and3, and http3. The default is http2
http2is_ipv6_enabledoptionalboolWhether the IPv6 is enabled for the distribution
truelogging_configoptionalobject({ bucket = optional(string) include_cookies = optional(bool) prefix = opt…The logging configuration that controls how logs are written to your distribution (maximum one)
nullordered_cache_behavioroptionallist(object({ allowed_methods = optional(list(string), ["GET", "HEAD", "OPTIONS"…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
[]originoptionalmap(object({ connection_attempts = optional(number) connection_timeout = optiona…One or more origins for this distribution (multiples allowed)
{}origin_access_controloptionalmap(object({ description = optional(string) name = optional(string) origin_type …Map of CloudFront origin access control
{…}origin_groupoptionalmap(object({ failover_criteria = object({ status_codes = list(number) }) member …One or more origin_group for this distribution (multiples allowed)
nullorigin_request_policiesoptionalmap(object({ name = optional(string) comment = optional(string) cookies_config =…Map of CloudFront origin request policies
nullprice_classoptionalstringThe price class for this distribution. One of `PriceClass_All`, `PriceClass_200`, `PriceClass_100`
nullrealtime_metrics_subscription_statusoptionalstringA flag that indicates whether additional CloudWatch metrics are enabled for a given CloudFront distribution. Valid values are `Enabled` and `Disabled`
Enabledresponse_headers_policiesoptionalmap(object({ name = optional(string) comment = optional(string) cors_config = op…Map of CloudFront response headers policies with their configurations
nullrestrictionsoptionalobject({ geo_restriction = object({ locations = optional(list(string)) restricti…The restrictions configuration for this distribution
{…}retain_on_deleteoptionalboolDisables the distribution instead of deleting it when destroying the resource through Terraform. If this is set, the distribution needs to be deleted manually afterwards
nullstagingoptionalboolWhether the distribution is a staging distribution
nulltagsoptionalmap(string)A map of tags to add to all resources
{}v2_loggingoptionalobject({ # Destination delivery_destination_configuration = optional(object({ de…Configuration block for v2 logging destination
nullviewer_certificateoptionalobject({ acm_certificate_arn = optional(string) cloudfront_default_certificate =…The SSL configuration for this distribution
{}viewer_mtls_configoptionalobject({ mode = optional(string) trust_store_config = optional(object({ trust_st…The viewer mTLS configuration for this distribution
nullvpc_originoptionalmap(object({ arn = string http_port = number https_port = number name = optional…Map of CloudFront VPC origins
nullwait_for_deploymentoptionalboolIf enabled, the resource will wait for the distribution status to change from InProgress to Deployed. Setting this to false will skip the process
null1 of 41 must be supplied; the rest have defaults. Showing 40, so the site stays a static download — the remaining 1 are in the source.
Outputs
22
cloudfront_cache_policiesThe cache policies created
cloudfront_distribution_arnThe ARN (Amazon Resource Name) for the distribution.
cloudfront_distribution_caller_referenceInternal value used by CloudFront to allow future updates to the distribution configuration.
cloudfront_distribution_domain_nameThe domain name corresponding to the distribution.
cloudfront_distribution_etagThe current version of the distribution's information.
cloudfront_distribution_hosted_zone_idThe CloudFront Route 53 zone ID that can be used to route an Alias Resource Record Set to.
cloudfront_distribution_idThe identifier for the distribution.
cloudfront_distribution_in_progress_validation_batchesThe number of invalidation batches currently in progress.
cloudfront_distribution_last_modified_timeThe date and time the distribution was last modified.
cloudfront_distribution_statusThe current status of the distribution. Deployed if the distribution's information is fully propagated throughout the Amazon CloudFront system.
cloudfront_distribution_trusted_signersList of nested attributes for active trusted signers, if the distribution is set up to serve private content with signed URLs
cloudfront_functionsThe CloudFront Functions created
cloudfront_monitoring_subscription_idThe ID of the CloudFront monitoring subscription, which corresponds to the `distribution_id`.
cloudfront_origin_access_controlsThe origin access controls created
cloudfront_origin_request_policiesThe origin request policies created
cloudfront_response_headers_policiesThe response headers policies created
cloudfront_vpc_originsThe IDS of the VPC origin created
connection_function_arnARN of the connection function
connection_function_etagETag of the connection function
connection_function_idID of the connection function
connection_function_live_stage_etagETag of the function's LIVE stage. Will be empty if the function has not been published
connection_function_statusStatus of the connection function
What the agent wires into the next module. An edge on the architecture diagram is one of these consumed by something else.