* aws_route.public_to_openvpn_clients: Error: more than 1 target specified. Only 1 of gateway_idnat_gateway_id, instance_id, network_interface_id, route_table_id orvpc_peering_connection_id is allowed.
Sample config:
resource "aws_route" "public_to_openvpn_clients" {
route_table_id = "${aws_route_table.public.id}"
destination_cidr_block = "${var.openvpn_cidr}"
instance_id = "${aws_instance.openvpn_server.id}"
}
resource "aws_instance" "openvpn_server" {
#...
}
resource "aws_route_table" "public" {
# ...
}
To reproduce:
aws_route change proceeds without issue in v0.6.12. Broken in v0.6.14.
I see the same issue. Is it going to be fixed in the next release or should I roll back to 0.6.12?
+1
Appears to be introduced in 3f41515d from #5321. The ec2 TerminateInstances leaves the eni dangling and is picked up by the aws_route.resourceAwsRouteRead Computed attribute.
I don't think computed attributes here are the ideal solution as we need a way to differentiate between what is desired and what has been automatically set by AWS. Preferably resourceAwsRouteUpdate should lookup the NetworkInterfaceId of the instance if only instance_id has been requested.
To add a bit of additional info to Atward's message for those unfamiliar with the problem (as I was until I ran into it...).
Upon creation using instance_id:
aws_route is sent to AWS via CreateRoute with just the instance_id attribute setnetwork_interface_id for the given instance_id and stores that information on the route table entry network_interface_id and instance_id in the stateAfter termination or taint of instance:
network_interface_id at that point. instance_id (which at this point should be different since the instance was terminated or tainted)network_interface_id (the old one) and an instance_id (the new one) on the node. 640859f works for me.
@jrnt30 can you create a pull request?
@atward I opened the PR. Would like to add an explicit test but this has worked for me as well and the current ACC tests are good.
+1
Unfortunately this is still an issue in Terraform v0.7.3. Is there a workaround?
Also seeing this in Terraform v0.7.4
Also seeing on 0.6.16
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
Unfortunately this is still an issue in Terraform v0.7.3. Is there a workaround?