Open iveskins opened 5 years ago
Ended up in the same rabbit hole, but by manually deleting subnets on the AWS ui...
Really bad...
So one option instead of destroying everything is to find where that code gets run, for example I use ag to search ag --hidden -Q "matchkeys(coalescelist(aws_subnet.private.*.id"
and comment out in the downloaded modules, it's just an output, so it's safe, unless you are using it in your project.
Once done, remove the comment and all good.
Thanks for sharing about ag. I wasn't aware of it. very helpful.
Ran into a similar issue (ran into the zipmap
error as well).
Since the subnet_names input is a list, the order becomes very important. Re-ordering the list causes subnets to be renamed which can be very problematic. While some of this is true regardless, and in general subnets should be considered immutable, naming doesn't really fall into that category.
On the surface, I think this can be resolved by supplying a map of subnet_identifier -> subnet_name.
Example:
Create subnets named: ec2-app, rds, elasticate Add a new subnet, but change the order: ec2-app, ec2-mgmt, rds, elasticache. Problem: the subnets are re-named and you now have RDS resources in a subnet called ec2-mgmt, and elasticache resources in rds.
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.