-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Description
I would like to add subnet tags that are specific to the name of the subnet.
We have processes that look up what subnet to use based on the configured tags.
I couldn't see an existing way of achieving this.
This functionality would work the same as private_subnet_tags_per_az and public_subnet_tags_per_az but use a map containing the subnet names instead.
I have added the functionality locally to test it worked as expected.
tags = merge(
{
Name = try(
var.private_subnet_names[count.index],
format("${var.name}-${var.private_subnet_suffix}-%s", element(var.azs, count.index))
)
},
var.tags,
var.private_subnet_tags,
lookup(var.private_subnet_tags_per_az, element(var.azs, count.index), {}),
try(
lookup(var.private_subnet_tags_per_subnet, element(var.private_subnet_names, count.index), {}),
{}
)
)
ForbiddenEra
Metadata
Metadata
Assignees
Labels
No labels