cockroachdb / terraform-provider-cockroach

Terraform provider for CockroachDB Cloud
Apache License 2.0
56 stars 10 forks source link

Wait for lock to release on cluster update and delete #105

Closed erademacher closed 1 year ago

erademacher commented 1 year ago

Previously, we assumed that all update operations were initiated by the user through Terraform, but it turns out that there are a number of locking jobs that are run automatically, like minor version upgrades. These are usually fairly short, but can still cause Terraform operations to fail.

This commit adds a wait to cluster update and delete actions if the cluster is locked. Since Terraform always performs a Read before Update or Delete, it's safe to check the cluster status in the Terraform state.