Skip to content

Commit

Permalink
Merge pull request #2 from schollii/cleanup
Browse files Browse the repository at this point in the history
fix typos, remove dead code
  • Loading branch information
schollii authored Feb 7, 2023
2 parents b427189 + aab7952 commit 5b6ae99
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 28 deletions.
45 changes: 21 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
This terraform module facilitates the management of terraform state remote
backends:

- One bucket for any number of terraform state.
- Support for the notion of "stack", consisting of multiple building blocks
in the form of terraform root modules. Eg a terraform state for a root
module focussed on a stack's network resources, another state for a root
module focussed on a stack's databases, another for a stack's EKS cluster,
etc.
- Automatic generation of the `backend.tf` of each sub-stack (ie root module) of each
stack, thus eliminating the chicken-and-egg dance that is otherwise
required to provision a new stack.
- Support for storing this module's state in s3 in same bucket (via
`this_tfstate_in_s3` variable).
This terraform module facilitates the management of terraform state remote backends:

- One bucket for any number of terraform tfstates.
- Based on the notion of "stacks", each consisting of multiple building blocks in the form of
terraform root modules (called sub-stacks). Eg a terraform state for a root module focussed on a
stack's network resources, another state for a root module focussed on a stack's databases,
another for a stack's EKS cluster, etc.
- Automatic generation of the `backend.tf` of each sub-stack (ie root module) of each stack, thus
eliminating the chicken-and-egg dance that is otherwise required to provision a new stack.
- Support for storing this module's state in s3 in same bucket (via `manager_tfstate_in_s3`
variable).
- Generate policies that can be used to control access to the backends
manager, and to all sub-stacks of specific stacks.

Expand Down Expand Up @@ -60,17 +57,17 @@ It may happen that the backends bucket (and therefore its replica) need to be re
some naming policy changes in your organization. AWS does not provide a means of doing this
directly. The following procedure is one that I use.

1. WARN your team that no one can use terraform on this terraform module, and ENSURE THAT
TERRAFORM PLAN SHOWS NO CHANGES NEEDED
1. WARN your team that no one can use terraform on this terraform module, and ENSURE THAT
TERRAFORM PLAN SHOWS NO CHANGES NEEDED.
2. change the value of `backends_bucket_name` (this new value is referred to here
as `NEW_BACKENDS_BUCKET_NAME`)
3. determine the path to the manager module in your tfstate. The easiest is to run `terraform state list | grep aws_s3_bucket look at your code or output of
terraform state list)
4. run `script/rename-backends-manager-bucket.sh NEW_BUCKET_NAME MODULE_PATH` (per the license
terms, this is provided as-is without any warranty - you assume all responsibility!)
5. If you had any `terraform_remote_state` in your sub-stacks, point them to the new bucket name
6. run `terraform apply` in any of the sub-stacks, this should show no init and no changes needed
7. manually delete the 2 old buckets when you are satisfied
as `NEW_BACKENDS_BUCKET_NAME`).
3. determine the path to the manager module in your tfstate. The easiest is to run `terraform state
list | grep aws_s3_bucket` look at your code or output of terraform state list).
4. run `script/rename-backends-manager-bucket.sh NEW_BUCKET_NAME MODULE_PATH` (per the license
terms, this is provided as-is without any warranty - you assume all responsibility!).
5. If you had any `terraform_remote_state` in your sub-stacks, point them to the new bucket name.
6. run `terraform apply` in any of the sub-stacks, this should show no init and no changes needed.
7. manually delete the 2 old buckets when you are satisfied it is safe to do so.

## Upgrades

Expand Down
4 changes: 0 additions & 4 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ terraform {
}
required_version = ">= 1.0"
}

#provider "aws" {
# alias = "replica"
#}

0 comments on commit 5b6ae99

Please sign in to comment.