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
Currently terraform doesn't allow to replace a gcs bucket or a bigquery dataset if bucket or dataset is non empty. It raises an error that force_destroy must be set in order to delete gcs bucket. This is a nice guard. However, to really delete and create new bucket or bigquery dataset it seems I have to do these steps:
first set force_destory flag, apply it
delete the resources by removing from tf config script
recreate resource with desired new configuration
Above causes me 3 code changes and 3 deployments to replace a resources.
Could this flow a simpler as.
set force_destory flag to true, apply it (internally first owner the flag and destroy the resource, create a new resource with the new config on new config set force_destroy to false again)
(if force_destroy is not set then raise an error just like it raises today)
Above means I can only deliberately (non unknowingly) replace the resource but in one code change and in one deployment.
Attempted Solutions
Refer use case
Proposal
Refer use case
References
No response
The text was updated successfully, but these errors were encountered:
Thanks for filing the issue. Terraform cannot change how force_destroy is handled, that is an attribute of the resource and the behavior is enforced solely by the provider.
Any general solution to Terraform controlling destroy policies would be covered by issue #24658. There is no clear design yet that is either more flexible than the current prevent_destroy mechanism, or could avoid the two-step process you mentioned
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Terraform Version
Use Cases
Currently terraform doesn't allow to replace a gcs bucket or a bigquery dataset if bucket or dataset is non empty. It raises an error that
force_destroy
must be set in order to delete gcs bucket. This is a nice guard. However, to really delete and create new bucket or bigquery dataset it seems I have to do these steps:force_destory
flag, apply itAbove causes me 3 code changes and 3 deployments to replace a resources.
Could this flow a simpler as.
force_destory
flag to true, apply it (internally first owner the flag and destroy the resource, create a new resource with the new config on new config setforce_destroy
to false again)(if force_destroy is not set then raise an error just like it raises today)
Above means I can only deliberately (non unknowingly) replace the resource but in one code change and in one deployment.
Attempted Solutions
Refer use case
Proposal
Refer use case
References
No response
The text was updated successfully, but these errors were encountered: