Gogs bcf7c70a01 Initial commit 5 years ago
..
README.md bcf7c70a01 Initial commit 5 years ago
s3.terraform-state.tf bcf7c70a01 Initial commit 5 years ago

README.md

Bootstrap

This creates some resources that I don't usually want to get rid of. Naturally, these will incur charges if you do not destroy them at some point. But they should be pretty cheap.

This creates:

  • A KMS Key aliased to alias/terraform for S3 encryption.
  • An encrypted S3 bucket to store terraform state with encryption enabled.

Bootstrapping

  1. Edit the file s3.terraform-state.tf a. Set the region and profile of your aws credentials a. Replace bucket = "fcm-terraform-state" with whatever you want your S3 bucket called. (Remember that the gbucket name must be globally unique)
  2. Run terraform init
  3. Run terraform apply

You now have an S3 bucket to store terraform state. That lets you and your collaborators work together without have to be on a shared server.

You'll need to update backend.tf in other directories to use it appropriately.

If you're on a large or very active team, you may want to lookup how to use dynamodb to provide proper locking, as well.