Terraform v0.6.16
https://gist.github.com/rjinski/b61b37ed371c76b3965db22c6a425957
Refreshing Terraform state prior to plan...
...
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.
Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.
~ aws_route_table.private.0
route.1031202073.cidr_block: "0.0.0.0/0" => ""
route.1031202073.gateway_id: "" => ""
route.1031202073.instance_id: "" => ""
route.1031202073.nat_gateway_id: "nat-06bd9ef37d96ac470" => ""
route.1031202073.network_interface_id: "" => ""
route.1031202073.vpc_peering_connection_id: "" => ""
route.2863962898.cidr_block: "" => "0.0.0.0/0"
route.2863962898.gateway_id: "" => "nat-06bd9ef37d96ac470"
route.2863962898.instance_id: "" => ""
route.2863962898.nat_gateway_id: "" => ""
route.2863962898.network_interface_id: "" => ""
route.2863962898.vpc_peering_connection_id: "" => ""
~ aws_route_table.private.1
route.2414893198.cidr_block: "" => "0.0.0.0/0"
route.2414893198.gateway_id: "" => "nat-068a007cc4ff8d721"
route.2414893198.instance_id: "" => ""
route.2414893198.nat_gateway_id: "" => ""
route.2414893198.network_interface_id: "" => ""
route.2414893198.vpc_peering_connection_id: "" => ""
route.2551236003.cidr_block: "0.0.0.0/0" => ""
route.2551236003.gateway_id: "" => ""
route.2551236003.instance_id: "" => ""
route.2551236003.nat_gateway_id: "nat-068a007cc4ff8d721" => ""
route.2551236003.network_interface_id: "" => ""
route.2551236003.vpc_peering_connection_id: "" => ""
Plan: 0 to add, 2 to change, 0 to destroy.
No changes
changes
No changes to configuration but rerunning terraform apply
shows changes to the routing tables
Hello –
Thank you for the gist of your config! I was able to reproduce your issue, and the key point is here:
~ aws_route_table.private.0
route.1031202073.gateway_id: "" => ""
route.1031202073.nat_gateway_id: "nat-06bd9ef37d96ac470" => ""
route.2863962898.gateway_id: "" => "nat-06bd9ef37d96ac470"
route.2863962898.nat_gateway_id: "" => ""
In your configuration, you're providing a NAT Gateway ID to the gateway_id
attribute. Changing your config to use this:
route {
cidr_block = "0.0.0.0/0"
nat_gateway_id = "${element(aws_nat_gateway.nat.*.id, count.index)}"
}
will resolve the issue here.
+1 Thank you
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
Hello –
Thank you for the gist of your config! I was able to reproduce your issue, and the key point is here:
In your configuration, you're providing a NAT Gateway ID to the
gateway_id
attribute. Changing your config to use this:will resolve the issue here.