You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Long-running operation improvements for mongodbatlas_cluster_outage_simulation resource (#3541)
* implement delete_on_create_timeout
* wait for delete in clean up to avoid trying to delete cluster before outage has been deleted
* use delete timeout(or default if not present) for clean up
* delete when state is SIMULATING
* increate time to reach simulating
* add missing timeout field in docs
resource/mongodbatlas_cluster_outage_simulation: Adds `delete_on_create_timeout` attribute to indicate whether to delete the resource if its creation times out
*`region_name` - (Required) The Atlas name of the region to undergo an outage simulation.
46
+
*`timeouts`- (Optional) The duration of time to wait for Cluster Outage Simulation to be created or deleted. The timeout value is defined by a signed sequence of decimal numbers with a time unit suffix such as: `1h45m`, `300s`, `10m`, etc. The valid time units are: `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. The default timeout for Cluster Outage Simulation create and delete is `25m`. Learn more about timeouts [here](https://www.terraform.io/plugin/sdkv2/resources/retries-and-customizable-timeouts).
47
+
*`delete_on_create_timeout` - (Optional) Flag that indicates whether to delete the resource if creation times out. Default is `true`. When Terraform apply fails, it returns immediately without waiting for cleanup to complete. If you suspect a transient error, wait before retrying to allow resource deletion to finish.
Timeout: d.Timeout(schema.TimeoutCreate) -time.Minute, // When using a CRUD function with a timeout, any StateChangeConf timeouts must be configured below that duration to avoid returning the SDK context: deadline exceeded error instead of the retry logic error.
101
-
MinTimeout: 1*time.Minute,
102
-
Delay: 3*time.Minute,
108
+
Timeout: d.Timeout(schema.TimeoutCreate) -oneMinute, // When using a CRUD function with a timeout, any StateChangeConf timeouts must be configured below that duration to avoid returning the SDK context: deadline exceeded error instead of the retry logic error.
returnnil// Don't fail cleanup if we can't reach a deletable state
212
+
}
213
+
214
+
finalState:=simulation.GetState()
215
+
switchfinalState {
216
+
case"SIMULATING": // If this isn't the state when triggering the delete, the API returns a 400 error: "INVALID_CLUSTER_OUTAGE_SIMULATION_STATE") Detail: Invalid cluster outage simulation state: START_REQUESTED, expected state: SIMULATING
0 commit comments