Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix route table importing to avoid route deletion
Import route tables using inline routes in the resource data. This is the same way resource data is structured when routes tables are read (and created) which enables imports to line up properly with existing resources. Previously, if you applied a state that included the import of a route table, all routes in the route table would be deleted. This bug occurred because the import function (resourceAwsRouteTableImportState()) would return a target state including both a route table resource and separate route resources for each route. The route table read function (resourceAwsRouteTableRead()) returns a state with a route table resource having inline routes. Despite being equivalent, since the states did not match, Terraform would delete all routes in the route table when applying the change plan. Fixes hashicorp#5631 Update functions names to comply with convention This commit is planned to occur after PR hashicorp#5687 which changes the names of these functions. In order to avoid merge conflicts at that time, this pre-emptively renames the functions.
- Loading branch information