Skip to content

v0.12.0 Disruptive Change

Compare
Choose a tag to compare
@cloudpossebot cloudpossebot released this 26 Apr 07:47
4e3780d

Not exactly a breaking change, but likely a disruptive one. The previous version was broken in its handling of the enabled flag. Upon review, we saw it was also fragile, dependent on the order in which you specified availability zones.

To fix these problems and for several other reasons, we switched from using count to enumerate resources that are allocated in each availability zone (AZ) to using for_each with the AZ name as the key. While this has many advantages going forward, it does mean that switching to this version will likely cause Terraform to try to destroy and recreate your subnets, which will fail if you have things provisioned in them. The structure of the Terraform has not changed substantially, so you can fix this by using terraform state rm and terraform import.

You might also take this opportunity to switch to using our more popular terraform-aws-dynamic-subnets module.

Fix variable enabled=false results in errors @paulrob-100 (#47)

what

  • Fix #46
  • Incorporates, supersedes, and closes #45
  • Incorporates, supersedes, and closes #41
  • Add local availability_zones which is empty if disabled
    • private_count and public_count are either 0 if disabled or the length of the local.availability_zones list
    • therefore aws resource counts will not reference empty list in element function
    • also guaranteed to have same number of elements in zipmap function
  • Added convenience local lists of tuples for outputs
  • Note az_ngw_ids is now an empty map if disabled - previously a map of constant "0"
  • dummy_az_ngw_ids is no longer referenced so remove
  • Transform local lists of tuples to output maps
    • since private_count and public_count are not both >0, no ellipsis needed in transform, producing single map value
    • output maps are all empty if disabled

why

  • Users should be able to set the enabled flag to false
  • This is useful when used in conjunction with the terraform-yaml-stack-config module where subnets may be disabled but yaml configuration ready to flip the flag

references