Simple terraform script for provisioning an s3 bucket with a cloudfront distribution and associated roles and policies
This script will provision an s3 bucket and an associated cloudfront distribution for that bucket.
You will need the terraform exe in your path. You can download it here.
- CD into this repository
- Run
terraform init
- Run
terraform plan
to verify the current configuration- Use
-out=<path-to-file>
to save the plan (does not create folders)
- Use
- Run
terraform apply
to provision the infrastructureterraform apply <path-to-file>
if you saved the plan
You will need the access key and secret key for an IAM User who effectively has global access to all actions on your AWS account.
Terraform does not roll back provisioned resources in the event of failure. If the script fails for whatever reason - run terraform destroy
to remove any resources.