3 ms·
Interesting, they are adopting the same pattern that I had discovered for AWS modules: * all modules take in a var.name and var.tags variables. * if the resou
by zimbatm 9y ago
Interesting, they are adopting the same pattern that I had discovered for AWS modules:
* all modules take in a var.name and var.tags variables.
* if the resource has a unique identifier, use var.name as a prefix (eg: "${var.name}-elb")
* all resources are tagged with the Name merged into var.tags
This allows to (1) avoid name clashes with the name prefix and (2) make sure everything is tagged and easier to filter by on AWS, while deferring most of the tagging decision to the user.
See https://github.com/terraform-aws-modules/terraform-aws-vpc/blob/master/main.tf#L10 https://github.com/terraform-aws-modules/terraform-aws-vpc/b...
EDIT: there is still an issue with autoscaling groups who take a list of tags instead of a map. https://github.com/terraform-aws-modules/terraform-aws-autoscaling/blob/master/modules/autoscaling_group/main.tf#L30-L33 https://github.com/terraform-aws-modules/terraform-aws-autos...