Hello, I have a need to check if an s3 bucket is e...
# general
s
Hello, I have a need to check if an s3 bucket is empty before I begin deleting the stack that contains the creation of it and various associated resources such as lifecycle policies, public access block settings, etc. Is there a way I can execute a simple script using boto3 to check the bucket is empty, which is triggered on a
destroy
event, but this code will execute prior to the execution of any objects being destroyed? The goal is to not begin the delete of any stack resources if the bucket is found to be non-empty and return an error message to the executor. Maybe something similar to sceptre's hooks concept (
before_delete/after_delete
) https://docs.sceptre-project.org/latest/docs/hooks.html
e
Not currently, but this is something we're looking into soon.
c