amazon-archives / data-pipeline-samples

This repository hosts sample pipelines
MIT No Attribution
464 stars 269 forks source link

Just some Boto guidance #48

Closed tbenade closed 8 years ago

tbenade commented 8 years ago

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

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()

Thanks Terry

tbenade commented 8 years ago

Got it figured. Did not realise delete would fail if S3 bucket had objects.