cloudfront-cdn

cloudposse/cloudfront-cdn/aws

Terraform Module HCL AWS

Terraform Module that implements a CloudFront Distribution (CDN) for a custom origin.

Install
module "cloudfront-cdn" {
source = "cloudposse/cloudfront-cdn/aws"
version = "1.6.0"
}
⭐ Source on GitHub 📦 Registry page
README

Terraform Module that implements a CloudFront Distribution (CDN) for a custom origin (e.g. website) and ships logs to a bucket. If you need to accelerate an S3 bucket, we suggest using terraform-aws-cloudfront-s3-cdn instead. > [!TIP] > #### 👽 Use Atmos with Terraform > Cloud Posse uses atmos to easily orchestrate multiple environments using Terraform. > Works with Github Actions, Atlantis, or Spacelift. > > > Watch demo of using Atmos with Terraform > > Example of running atmos to manage infrastructure from our Quick Start tutorial. > Usage For a complete example, see examples/complete. For automated tests of the complete example using bats and Terratest (which tests and deploys the example on AWS), see test. ```hcl module "cdn" { source = "cloudposse/cloudfront-cdn/aws" # Cloud Posse rec

Inputs (50)
NameTypeDescriptionDefault
web_acl_idstringID of the AWS WAF web ACL that is associated with the distribution""
forward_cookiesstringSpecifies whether you want CloudFront to forward cookies to the origin. Valid op"none"
geo_restriction_typestringMethod that use to restrict distribution of your content by country: `none`, `wh"none"
labels_as_tagsset(string)Set of labels (ID elements) to include as tags in the `tags` output. Default is [ "default" ]
label_key_casestringControls the letter case of the `tags` keys (label names) for tags generated by null
origin_http_portnumberThe HTTP port the custom origin listens on"80"
origin_protocol_policystringThe origin protocol policy to apply to your origin. One of http-only, https-only"match-viewer"
cached_methodslist(string)List of cached methods (e.g. ` GET, PUT, POST, DELETE, HEAD`)[ "GET", "HEAD" ]
response_headers_policy_idstringThe identifier for a response headers policy""
parent_zone_namestringName of the hosted zone to contain this record (or specify `parent_zone_id`)""
http_versionstringThe maximum HTTP version to support on the distribution. Allowed values are http"http2"
dns_aliases_enabledboolSet to false to prevent dns records for aliases from being createdtrue
default_ttlnumberDefault amount of time (in seconds) that an object is in a CloudFront cache60
origin_typestringThe type of origin configuration to use. Valid values are 'custom' or 's3'."custom"
additional_tag_mapmap(string)Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not add{}
origin_shieldobject({ enabled = optionaThe CloudFront Origin Shield settingsnull
is_ipv6_enabledboolState of CloudFront IPv6true
log_bucket_fqdnstringOptional fqdn of logging bucket, if not supplied a bucket will be generated.""
log_standard_transition_daysnumberNumber of days to persist in the standard storage tier before moving to the glac30
viewer_minimum_protocol_versionstringThe minimum version of the SSL protocol that you want CloudFront to use for HTTP"TLSv1.2_2021"
… and 10 more inputs
Outputs (9)
cf_arn — ARN of CloudFront distribution
cf_domain_name — Domain name corresponding to the distribution
cf_hosted_zone_id — CloudFront Route 53 Zone ID
cf_origin_access_identity — A shortcut to the full path for the origin access identity to use in CloudFront
logs — Logs resource
cf_id — ID of CloudFront distribution
cf_aliases — Extra CNAMEs of AWS CloudFront
cf_status — Current status of the distribution
cf_etag — Current version of the distribution's information
Resources (2)
aws_cloudfront_distributionaws_cloudfront_origin_access_identity
Details
FrameworkTerraform Module
LanguageHCL
Version1.6.0
Cloud AWS
★ Stars102
Forks124
Total downloads704.7k
Inputs50
Outputs9
Resources2
Examples4
LicenseApache-2.0
Namespacecloudposse
Updated