terraform-aws-named-subnets icon indicating copy to clipboard operation
terraform-aws-named-subnets copied to clipboard

Cant change subnet names.

Open iveskins opened this issue 5 years ago • 4 comments

After creating subnets with the cloudposse terraform-aws-named-subnets module, There might be a need to re-name the subnets. I would expect that simply changing the items in the 'subnet_names' list would let the subnets name tag be updated, or if needed, a subnet be recreated with the new name. I get the following error if I change the subnet_name list item. To work around this I had to destroy my project and re-create all resources again with the new name. Even If I update the name in the AWS gui, I was not able to get around this.


Error: Error refreshing state: 2 error(s) occurred:

* module.private_subnets.output.named_subnet_ids: zipmap: count of keys (1) does not match count of values (0) in:

${zipmap(var.subnet_names, matchkeys(coalescelist(aws_subnet.private.*.id, aws_subnet.public.*.id), coalescelist(aws_subnet.private.*.tags.Named, aws_subnet.public.*.tags.Named), var.subnet_names))}
* module.public_subnets.output.named_subnet_ids: zipmap: count of keys (1) does not match count of values (0) in:

${zipmap(var.subnet_names, matchkeys(coalescelist(aws_subnet.private.*.id, aws_subnet.public.*.id), coalescelist(aws_subnet.private.*.tags.Named, aws_subnet.public.*.tags.Named), var.subnet_names))}

iveskins avatar May 21 '19 00:05 iveskins