Skip to content

Commit

Permalink
Make terraform init prompt for bucket name instead of defaulting to…
Browse files Browse the repository at this point in the history
… local backend

This makes it harder to do the wrong thing. With this change, we avoid
a potential footgun when developers use `terraform init` instead of
`terraform init -backend-config=dev.s3.tfbackend`.

This isn't a functional change because we were already using encryption
on everything in our state buckets.
  • Loading branch information
GaryGSC committed Jun 24, 2024
1 parent a7dfa3c commit 356615a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion terraform-iac/app/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ terraform {
backend "s3" {
# The rest of the backend config is passed in
# https://developer.hashicorp.com/terraform/language/settings/backends/configuration#partial-configuration
region = "us-west-2"
encrypt = true
region = "us-west-2"
}
required_providers {
aws = {
Expand Down
3 changes: 2 additions & 1 deletion terraform-iac/setup/setup.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ terraform {
backend "s3" {
# The rest of the backend config is passed in
# https://developer.hashicorp.com/terraform/language/settings/backends/configuration#partial-configuration
region = "us-west-2"
encrypt = true
region = "us-west-2"
}
required_providers {
aws = {
Expand Down

0 comments on commit 356615a

Please sign in to comment.