From 4eb42914535849af3bec66e3295c1ef098841b40 Mon Sep 17 00:00:00 2001 From: 1jc <34551673+1jc@users.noreply.github.com> Date: Mon, 14 Mar 2022 16:35:49 -0700 Subject: [PATCH 1/2] DeletingAllS3BucketsIssue116.py 1jc for Issue 116 Sprint 4 " Issue 116 Fix script to delete all s3 buckets even with data" --- devops/DeleteAllS3BucketsIssue116.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 devops/DeleteAllS3BucketsIssue116.py diff --git a/devops/DeleteAllS3BucketsIssue116.py b/devops/DeleteAllS3BucketsIssue116.py new file mode 100644 index 0000000..8edb9e6 --- /dev/null +++ b/devops/DeleteAllS3BucketsIssue116.py @@ -0,0 +1,7 @@ +#s3BucketDelete.py for issue 87 Create a cleanup script for all s3 buckets 1jc +#revision for issue 116 Sprint 4 Fix issue #87 Fix script to delete all s3 buckets even with data 1jc + +import boto3 +client = boto3.client('s3') +response = client.delete_buckets() +print(response) \ No newline at end of file From a8cb2b5d070f59df8d8b1e9320fa61d3f7c042f1 Mon Sep 17 00:00:00 2001 From: 1jc <34551673+1jc@users.noreply.github.com> Date: Wed, 16 Mar 2022 21:16:38 -0700 Subject: [PATCH 2/2] Update DeleteAllS3BucketsIssue116.py 1jc made minor correction to list buckets then delete buckets to update file "DeleteAllS33BucketIssue116.py" --- devops/DeleteAllS3BucketsIssue116.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/devops/DeleteAllS3BucketsIssue116.py b/devops/DeleteAllS3BucketsIssue116.py index 8edb9e6..d06d546 100644 --- a/devops/DeleteAllS3BucketsIssue116.py +++ b/devops/DeleteAllS3BucketsIssue116.py @@ -3,5 +3,9 @@ import boto3 client = boto3.client('s3') +response = client.list_buckets() +for name in response ['Buckets']: + print (name['Name']) + response = client.delete_buckets() -print(response) \ No newline at end of file +print(response)