Skip to content

Fix: Isolate Terraform state per module so both can be deployed at the same time#105

Open
tyagidevansh wants to merge 1 commit into
ine-labs:masterfrom
tyagidevansh:fix/per-module-terraform-state
Open

Fix: Isolate Terraform state per module so both can be deployed at the same time#105
tyagidevansh wants to merge 1 commit into
ine-labs:masterfrom
tyagidevansh:fix/per-module-terraform-state

Conversation

@tyagidevansh

Copy link
Copy Markdown

Both modules shared one Terraform state bucket (do-not-delete-awsgoat-state-files-<ACCOUNT_ID>) and one state key (terraform.tfstate).

As a result:

  • The Apply guard saw the other module's state and refused to deploy a second module ("A Previous AWSGoat deployment exists").
  • Running Destroy on one module pulled the other module's state. Since the modules pin different AWS provider versions (module-1 ~> 5.24, module-2 ~> 3.27), this crashed with Error: no schema available ... while reading state; this is a bug in Terraform.

Nowhere in the Readme is it mentioned that both modules cannot be run at the same time. It is not a stretch to think that many users would try to run both modules at the same time, and would notice Terraform apply failing. Though this does not make the project completely unusable, I think the ability to deploy both at the same time should be present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants