Import of an aws_route_table with propagation erroneously imports propagated routes #5099
Labels
bug
Addresses a defect in current functionality.
service/ec2
Issues and PRs that pertain to the ec2 service.
Milestone
When importing a route table that has had routes propagated to it, terraform improperly reads the propagated routes as actual configured routes.
My guess is that the
EnableVgwRoutePropagation
logic in https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_route_table.go either isn't being used during the import, or is being ran at a time before the propagation info is available.Community Note
Terraform Version
Terraform v0.11.7
Affected Resource(s)
Terraform Configuration Files
Here's an example terraform config
Debug Output
The relevant part of the
import
output that's wrong is this:These routes then appear in the plan/apply output as well, and the only way to get around it is to manually
state rm
each of them. If you try to do an apply, the following happens:Expected Behavior
When importing a route table with routes that propagated into it, I'd expect those routes to be ignored, similar to how they're ignored normally.
Actual Behavior
The propagated routes are imported, causing the state file to be invalid and unusable without manual intervention (
state rm
).Steps to Reproduce
terraform apply
the above configurationterraform state rm aws_route_table.test_table
terraform import aws_route_table.test_table rtb-123456
terraform plan
-- you'll see the propagated routes in a "to delete" stateterraform apply
-- apply will try and delete them but be unable toReferences
EnableVgwRoutePropagation
. terraform#722The text was updated successfully, but these errors were encountered: