Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
When deleting an object storage bucket, with objects, it fails with:
Error: 409-BucketNotEmpty, Bucket named '<bucket_name>' is not empty. Delete all object versions first.
to workaround, manual deletion of objects is required; which is not ideal for automation. Alternatively, it is required to implement a local-exec Provisioner to call the OCI API which does support the force delete option:
oci os object bulk-delete -ns <oci_object_storage.namespace> -bn <bucket_name> --force
force_delete - (Optional) (Updatable) Whether or not to destroy the bucket if it contains objects. By default, force_delete is set to false and bucket deletion will fail if it contains objects. Set force_delete to true to destroy the bucket and all its objects.
Community Note
Description
When deleting an object storage bucket, with objects, it fails with:
to workaround, manual deletion of objects is required; which is not ideal for automation. Alternatively, it is required to implement a local-exec Provisioner to call the OCI API which does support the force delete option:
New or Affected Resource(s)
oci_objectstorage_bucket
Potential Terraform Configuration
force_delete
is set to false and bucket deletion will fail if it contains objects. Setforce_delete
to true to destroy the bucket and all its objects.References
documentation