[StaticSite]: Isn’t the stack/bucket supposed to d...
# help
d
[StaticSite]: Isn’t the stack/bucket supposed to delete clean? Right now it appears as though its erroring out as though its not able to emtpy+delete the bucket.
social cards bucket is my issue.. but the gatsby one should auto-empty. no?
This might just be erroring on both but the only one that might have failed is the social cards bucket….. let me try adding auto-delete
oh… nope… I DO have
Copy code
new sst.Bucket(this, 'WebsiteBucket', {
      s3Bucket: {
        // Delete everything on remove
        autoDeleteObjects: true,
        removalPolicy: cdk.RemovalPolicy.DESTROY,
      },
    })
on that bucket…. so now I’m stumped
f
Hey @Dan Van Brunt, if u looked at stack events prior to this, do u see two Custom Resources of type
Custom::S3AutoDeleteObjects
being removed?
^ to add some context, when
autoDeleteObjects
is enabled, a custom resource is added to the stack and on delete, it will all items in the bucket in a Lambda function.
d
Can’t check that now, stack is now deleted (manually emptying bucket) but I have an identical stack “pre-delete” and it has 3 of these…
one for each of the 3 buckets in my stack
each will have things in them that I want deleted
f
I see. If you get a chance, you can check the CW log for the auto delete objects Lambda function? I wonder if the auto delete Lmabda function didn’t get called or failed to run.
d
Is there a way to do that for deleted stack functions… or is this function part of the CDK boilerplate stack?
f
Yeah, the CW log group are retained by default. The function is part of the application stack.
d
kk will hunt for it