Demonstrate how to use Terraform to create and manage content and its metadata (wrt MIME types and caching) on S3.
This project uses Terraform (get it from
https://www.terraform.io/downloads.html). To run main.tf
, you'll need:
- AWS credentials in
~/.aws/credentials
under a profile namedaws_admin
(or you can change the profile name inmain.tf
) - To change the bucket name to something unique
Then, run Terraform with:
# Initialize terraform in the current directory and download the AWS provider
terraform init
# Preview what changes will be made
terraform plan
# Make the changes (create and populate the S3 bucket)
terraform apply
Credit to https://engineering.statefarm.com/blog/terraform-s3-upload-with-mime/
for the content of mime.json
(source from
https://github.com/d-henn/s3-upload-terraform-example/blob/master/data/mime.json)