github cloudposse/terraform-aws-dynamic-subnets 0.30.0
v0.30.0

latest releases: 2.4.2, v2, 2.4.1...
3 years ago

Warning

This release will change the tags on many of your resources. Resources which are created for each availability zone rather than each region should have the availability zone appended to the end of the ID that is the value of the "Name" tag. Previously, the full AWS region code was used, with dashes replaced by the null-label delimiter (which is dash by default, so usually no changes were made). Now the AZ code used is selectable and by default is Cloud Posse's new "short" code, which uses only digits and lower case letters.

Usage note

Tags you specify as inputs to modules override any generated tags. This includes the "Name" tag. Some people are using code like this:

module "label" {
  source      = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.16.0"
  ... 
  tags = var.tags
}
locals {
  # THIS IS MISGUIDED. Do not merge tags. Supply the new tags and the modules will merge them for you.
  tags = merge(module.label.tags, map(format("kubernetes.io/cluster/%s-%s-%s-eks-cluster", var.namespace, var.environment, var.stage), "shared"))
}
module "subnets" {
  source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=tags/0.22.0"
  ...
  tags = local.tags
}

Because of the merge, local.tags includes a Name tag which takes precedence over terraform-aws-dynamic-subnets generated tags, preventing the module from enhancing the the Name tag with additional disambiguation information. The merge is not required, and instead you should just use

locals {
   tags = map(format("kubernetes.io/cluster/%s-%s-%s-eks-cluster", var.namespace, var.environment, var.stage), "shared")
}
Use compact AZ codes in tags @Nuru (#100)

what

  • When resources are tagged with names that have the Availability Zone appended, use Cloud Posse's new "short" AZ codes
  • Update context.tf and null-label to v0.19.2

why

  • Full Availability Zone (AZ) codes have 2 dashes in them (e.g. "us-east-2") and Cloud Posse's naming convention defaults to using dashes as token separators. Additionally, previous code replaced the dashes in the AZ codes with whatever delimiter was in use for labels. This means that the previous availability zone was treated as 3 tokens when it is more appropriately treated as 1 token. Cloud Posse's new short codes use only digits and lower case letters, ensuring they are always treated as a single token.
  • Stay in sync with other modules

references

Cloud Posse's AWS AZ short codes

Don't miss a new terraform-aws-dynamic-subnets release

NewReleases is sending notifications on new releases.