Moving the Remote Terraform State Items
Due to recent refactoring, I figured out that I need to move some Terraform state items from one S3 path to another. And then to merge configurations with other stuff at the destination directory. Terraform can move state items around, but this feature doesn’t work with remote states. Here is one way of doing it. Example Use Case First, let’s consider the following situation, this is configuration directory tree output: . ├── db │ └── test │ ├── main.tf (s3 key: aws/db/test/terraform.tfstate) │ └── rds.tf ├── test │ ├── main.tf (s3 key: aws/test/terraform.tfstate) │ ├── sqs.tf You want to merge db/test state items into aws/test/terraform.tfstateRead More →