cloudfront-s3-cdn

cloudposse/cloudfront-s3-cdn/aws

Terraform Module HCL AWS

Terraform module to easily provision CloudFront CDN backed by an S3 origin

Install
module "cloudfront-s3-cdn" {
source = "cloudposse/cloudfront-s3-cdn/aws"
version = "2.1.0"
}
plain text: /constructs/tfmod-cloudposse-cloudfront-s3-cdn-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

Terraform module to provision an AWS CloudFront CDN with an S3 origin. > [!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. The following will create a new s3 bucket eg-prod-app for a cloudfront cdn, and allow principal1 to upload to prefix1 and prefix2, while allowing principal2 to manage the whole bucket. ```hcl module "cdn" { source = "cloudposse/cloudfr

Inputs (50)
NameTypeDescriptionDefault
realtime_log_config_arnstringThe ARN of the real-time log configuration that is attached to this cache behavinull
cors_allowed_methodslist(string)List of allowed methods (e.g. GET, PUT, POST, DELETE, HEAD) for S3 bucket[ "GET" ]
parent_zone_idstringID of the hosted zone to contain this record (or specify `parent_zone_name`). Renull
dns_alias_enabledboolCreate a DNS alias for the CDN. Requires `parent_zone_id` or `parent_zone_name`false
namestringID element. Usually the component or solution name, e.g. 'app' or 'jenkins'. Thinull
custom_originslist(object({ domain_name A list of additional custom website [origins](https://www.terraform.io/docs/prov[]
s3_access_log_prefixstringPrefix to use for S3 Access Log object keys. Defaults to `logs/${module.this.id}""
regex_replace_charsstringTerraform regular expression (regex) string. Characters matching the regex will null
origin_bucketstringName of an existing S3 bucket to use as the origin. If this is not provided, it null
forward_header_valueslist(string)A list of whitelisted header values to forward to the origin (incompatible with [ "Access-Control-Request-Headers",
function_associationlist(object({ event_type A config block that triggers a CloudFront function with specific actions. See th[]
extra_origin_attributeslist(string)Additional attributes to put onto the origin label[ "origin" ]
minimum_protocol_versionstringCloudfront TLS minimum protocol version. If `var.acm_certificate_arn` is unset, ""
viewer_protocol_policystringLimit the protocol users can use to access content. One of `allow-all`, `https-o"redirect-to-https"
trusted_signerslist(string)The AWS accounts, if any, that you want to allow to create signed URLs for priva[]
environmentstringID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'stnull
cached_methodslist(string)List of cached methods (e.g. GET, PUT, POST, DELETE, HEAD)[ "GET", "HEAD" ]
max_ttlnumberMaximum amount of time (in seconds) that an object is in a CloudFront cache31536000
trusted_key_groupslist(string)A list of key group IDs that CloudFront can use to validate signed URLs or signe[]
enabledboolSet to false to prevent the module from creating any resourcesnull
… and 10 more inputs
Outputs (18)
logs — Log bucket resource
cf_status — Current status of the distribution
cf_etag — Current version of the distribution's information
cf_origin_groups — List of Origin Groups in the CloudFront distribution.
cf_origin_ids — List of Origin IDs in the CloudFront distribution.
aliases — Aliases of the CloudFront distribution.
cf_id — ID of AWS CloudFront distribution
cf_identity_iam_arn — CloudFront Origin Access Identity IAM ARN
cf_access_control_id — CloudFront Origin Access Control ID
cf_primary_origin_id — The ID of the origin created by this module.
s3_bucket_arn — ARN of origin S3 bucket
s3_bucket_domain_name — Domain of origin S3 bucket
cf_arn — ARN of AWS CloudFront distribution
cf_domain_name — Domain name corresponding to the distribution
cf_hosted_zone_id — CloudFront Route 53 zone ID
s3_bucket — Name of origin S3 bucket
cf_s3_canonical_user_id — Canonical user ID for CloudFront Origin Access Identity
s3_bucket_policy — Final computed S3 bucket policy
Resources (13)
aws_cloudfront_distributionaws_cloudfront_origin_access_controlaws_cloudfront_origin_access_identityaws_s3_bucketaws_s3_bucket_aclaws_s3_bucket_cors_configurationaws_s3_bucket_ownership_controlsaws_s3_bucket_policyaws_s3_bucket_public_access_blockaws_s3_bucket_server_side_encryption_configurationaws_s3_bucket_versioningrandom_passwordtime_sleep
Details
FrameworkTerraform Module
LanguageHCL
Version2.1.0
Cloud AWS
★ Stars287
Forks253
Total downloads2.6M
Inputs50
Outputs18
Resources13
Examples1
Submodules1
LicenseApache-2.0
Namespacecloudposse
Updated