This message was deleted.
# general
s
This message was deleted.
b
Can confirm, we have the same problem with very large S3 Buckets and it takes literally hours to delete them with pulumi. Usually those stacks fail (timeout) on destroy and we have to manually clean-up the S3 Buckets (using CLI or AWS Web Console) to speed things up.
w
One more addition. The objects are not big 2-3 KB each. In total like 40MB.
b
Same here, we have thousands (if not millions) of small to medium sized objects (KB to few MB).
g
Do you manage each object with pulumi or did you try
force_destroy=True
?
b
could you run a performance trace here? https://www.pulumi.com/docs/troubleshooting/#performance
b
In my case we only manage the S3 Bucket with Pulumi, the objects are created by applications (not Pulumi).
w
We also maintain only the bucket with pulumi. The objects are created by apps. The pulumi uses force destroy, otherwise wouldn't be able to delete the bucket.
I executed the pulumi destroy now with the traces turned on suggested by @billowy-army-68599. The 45 minutes are spent in /pulumirpc.ResourceProvider/Delete.
b
@witty-helmet-74677 just to be sure I'm understanding, you're populating a bucket with an external program then doing a force delete?
as pointed out by @white-balloon-205 (thanks!) it seems we inherit this from the upstream AWS provider: https://github.com/hashicorp/terraform-provider-aws/issues/12146
w
Thanks @billowy-army-68599. Answer to your question is yes, bucket is populated with a external program (actually to reproduce I just synchronize a local folder into a bucket: aws sync - this is the fastest way I found) and then I destroy the cluster which will call the force_delete.
these are the args used to create the bucket: s3.NewBucket(ctx, "my-bucket-12354698", &s3.BucketArgs{ AccelerationStatus: nil, Acl: pulumi.String("private"), Arn: nil, Bucket: nil, BucketPrefix: nil, CorsRules: nil, ForceDestroy: pulumi.Bool(true), Grants: nil, HostedZoneId: nil, LifecycleRules: s3.BucketLifecycleRuleArray{&s3.BucketLifecycleRuleArgs{Enabled: pulumi.Bool(true), Expiration: &s3.BucketLifecycleRuleExpirationArgs{Days: pulumi.Int(10)}}}, Loggings: nil, ObjectLockConfiguration: nil, Policy: nil, ReplicationConfiguration: nil, RequestPayer: nil, ServerSideEncryptionConfiguration: &s3.BucketServerSideEncryptionConfigurationArgs{ Rule: &s3.BucketServerSideEncryptionConfigurationRuleArgs{ ApplyServerSideEncryptionByDefault: &s3.BucketServerSideEncryptionConfigurationRuleApplyServerSideEncryptionByDefaultArgs{ KmsMasterKeyId: pulumi.String("<key_id>"), SseAlgorithm: pulumi.String("aws:kms"), }, BucketKeyEnabled: pulumi.Bool(true), }, }, Tags: nil, TagsAll: nil, Versioning: nil, Website: nil, WebsiteDomain: nil, WebsiteEndpoint: nil, })