Add force_destroy field to google_bigtable_instance resource #18291
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #18194
Background
If a user tries to delete a bigtable instance that contains backups they will experience an API error saying deletion cannot happen due to backups.
There currently isn't a way to address this through Terraform; bigtable backups are not supported by the provider, so users will need to manually delete backups to unblock Terraform.
This PR adds a force_destroy field that will delete all backups when the instance is being deleted. This behaviour is opt-in, so there's no risk of unintentional deletion of backups. It copies some existing code from the force_destroy field on google_spanner_instance.
Testing
The acceptance test in this PR uses the http provider to make a backup by directly interacting with the API.
If/when backups are supported by the provider the test should be refactored.
Release Note Template for Downstream PRs (will be copied)
O
Derived from GoogleCloudPlatform/magic-modules#10799