Skip to content

comerford/tf-aws-securecdn

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

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