Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/aws_default_route_table: Fixes for creation and recreation b…
…ehavior when Default Route Table is missing (#10981) Reference: #398 Reference: #3551 Reference: #9009 Previously on creation, if the Default Route Table was incorrectly configured or non-existent, the resource would unexpectedly attempt to remove itself from the Terraform state and propose recreation immediately. Prior to Terraform 0.12, this behavior was errantly acceptable. In Terraform 0.12, resources are required to return Terraform state about themselves during creation or throw an error explaining why the creation failed. Previously on read, if the Default Route Table was missing (e.g. due to the VPC being deleted outside Terraform), the resource would return an error and require operators to manually perform a `terraform state rm` command instead of proposing resource recreation. Output from new acceptance testing before code updates: ``` --- FAIL: TestAccAWSDefaultRouteTable_basic (20.02s) testing.go:628: Step 0, expected error: errors during apply: Provider produced inconsistent result after apply: When applying changes to aws_default_route_table.foo, provider "aws" produced an unexpected new value for was present, but now absent. This is a bug in the provider, which should be reported in the provider's own issue tracker. To match: TBD --- FAIL: TestAccAWSDefaultRouteTable_disappears_Vpc (20.27s) testing.go:635: Step 0 error: errors during follow-up refresh: Error: Default Route table not found testing.go:696: Error destroying resource! WARNING: Dangling resources may exist. The full state and error is shown below. Error: errors during refresh: Default Route table not found State: <nil> ``` Output from acceptance testing after code updates: ``` --- PASS: TestAccAWSDefaultRouteTable_disappears_Vpc (20.46s) --- PASS: TestAccAWSDefaultRouteTable_basic (40.99s) --- PASS: TestAccAWSDefaultRouteTable_vpc_endpoint (49.71s) --- PASS: TestAccAWSDefaultRouteTable_swap (73.89s) --- PASS: TestAccAWSDefaultRouteTable_Route (87.09s) --- PASS: TestAccAWSDefaultRouteTable_Route_TransitGatewayID (374.87s) ```
- Loading branch information