core_route_table_default_resource should use CreatedPending instead of CreatedTarget. #2094
Labels
awaiting-affected-resources
Please Provide the affected resource name in description. ex. Affected resource - oci_core_instance
bug
The core_route_table_default resource sets the DeletedPending lifecycle target to be the same as the CreatedActual target. This works fine on OCI, because OCI never transitions the RouteTable's lifecycleState to anything when the RouteRules are modified. But on PCA that RouteTable will change to PROVISIONING state (by design to prevent multiple UpdateRouteTable operations), and on destroy the terraform script fails because it detects that the RouteTable is in an unexpected lifecycle state.
The fix would be for DeletedPending setting to be the same as the CreatedPending() setting instead of CreateTarget().
Community Note
Terraform Version and Provider Version
terraform -v
Terraform v1.5.7
on linux_amd64
Affected Resource(s)
affected_resources = core_route_table_default
Terraform Configuration Files
provider.tf
variable.tf
drgsetup.tf
Debug Output
Panic Output
Expected Behavior
terraform destroy --auto-approve
Actual Behavior
Terraform destroy reports the following error when first run. A rerun works since all the RouteRules have already been deleted.
2024-02-29T11:33:41.145Z [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot
╷
│ Error: During deletion, Terraform expected the resource to reach state(s): AVAILABLE, but the service reported unexpected state: PROVISIONING.
│
│
╵
╷
│ Error: During deletion, Terraform expected the resource to reach state(s): AVAILABLE, but the service reported unexpected state: PROVISIONING.
│
│
╵
Steps to Reproduce
Important Factoids
This was run on a PCA Rack. It will only show up when Terraform is run on a PCA or CCC appliance. It will always happen if a Drg RouteRule is created in the Default RouteTable. It will sometimes happen on other Route Rules.
References
The text was updated successfully, but these errors were encountered: