Skip to content

Terraform config for creating a secure S3-backed asset store behind a Cloudfront CDN

License

Notifications You must be signed in to change notification settings

comerford/tf-aws-securecdn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secure S3 Backed CDN with Terraform

This repo contains a generalised Terraform config for creating a secure S3-backed asset store behind a Cloudfront CDN.

How do I use it?

You will need the following at a minimum:

  • AWS API keys with sufficient permissions to:
    • Add route53 resource records
    • Create Cloudfront distributions (and origin identities)
    • Create S3 Buckets
  • An ACM SSL cert in us-east-1 (currently only available in that region)
  • A route53 hosted zone for the chosen domain (in the same account)

First thing to do is to create the terraform.tfvars file (example included). The keys can be passed in via environment variables (Note: if you do add the tfvars file it will be git ignored, for safety). Sample (example.com) versions of the relevant pieces have been included, and there are only ~10 variables that need to be set.

More Information

I wrote up a blog post, with some more of the reasoning behind this config (and it even has a diagram), which can be found over on comerford.net

About

Terraform config for creating a secure S3-backed asset store behind a Cloudfront CDN

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published