Buckets that use versioning can't be deleted
See original GitHub issueIt seems that pulumi cannot automatically delete buckets that have versioned contents. When attempting to pulumi destroy
stacks with such buckets, pulumi stays in the deleting...
phase forever. If I open up the S3 console and manually delete all content – including all versions – then pulumi destroy
completes successfully.
Note that this is NOT an issue with forceDestroy
– it is set to true
in my stack.
Someone on slack pointed me to this page, which says that buckets cannot be deleted if they have > 100,000 objects or have versioning enabled. It sounds as if the API should return a failure code, though that’s not stated declaratively and I haven’t tried the manual operation through e.g. the aws
cli.
I realize it would likely be tricky to have pulumi delete all the bucket content for you, but perhaps an error could be thrown (if indeed the operation does result in a failure code) or a warning that the program may hang could be printed (if the actual API call itself hangs).
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Forgive me as I’m still wrapping my head around the difference between the Pulumi AWS V1 and V2…
I’m running
@pulumi/aws
version5.14.0
(not the latest, but should have this change). I’m using the V2 approach to buckets and object lifecycle configuration. Should the change by the terraform provider fix the behaviour of the V2 buckets?I have observed in August/September that I was having the issue the OP described - since Pulumi could not destroy the bucket for me I first tried to go in manually to delete the objects and versions, but in the end had to use a particular AWS CLI command to delete them all for me, before the Pulumi command to destroy the bucket actually worked. My preference of course would be that Pulumi is able to control this for me.
Yes - that fix would have been available as of https://github.com/pulumi/pulumi-aws/releases/tag/v5.2.0.