if r.resource_type == "AWS::S3::Bucket":
if not s3:
s3 = boto3.resource("s3")
bucket = s3.Bucket(r.physical_resource_id)
for key in bucket.objects.all():
key.delete()
Was wondering why you felt the need to explicitly delete s3 buckets that have been provisioned by CloudFormation. Are they not being handled by Stack.Delete()
Hi,
Poking around in your code looking for useful Boto examples I noted you are explicitly deleting s3 buckets provisioned by a CloudFormation stack.
https://github.com/awslabs/data-pipeline-samples/blob/master/setup/stacker.py#L79
Was wondering why you felt the need to explicitly delete s3 buckets that have been provisioned by CloudFormation. Are they not being handled by Stack.Delete()
Thanks Terry