cloudposse / terraform-aws-transit-gateway

Terraform module to provision AWS Transit Gateway, AWS Resource Access Manager (AWS RAM) Resource, and share the Transit Gateway with the Organization or another AWS Account.
https://cloudposse.com/accelerate
Apache License 2.0
53 stars 47 forks source link

Disabling the module is ignored and infrastructure is created #10

Closed paulrob-100 closed 2 years ago

paulrob-100 commented 3 years ago

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

When I set the enabled variable to false, the module infrastructure is created.

On attempting to run the terratest, I also encountered an error with "aws_route" "count" value depends on resource attributes that cannot be determined until apply. It seems the tgw can only deployed if the base vpc infrastructure has already been deployed and existing in the state file.

Expected Behavior

When I set the enabled = false variable, I expect the module to be deployed with no errors, no infrastructure to be created and the outputs to be empty.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to 'examples/complete'
  2. Run 'terraform apply -var enabled=false'
  3. See that the transit gateway and tgw route tables etc are all created

Screenshots

N/A

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

Additional Context