刪除桶
Sam 對自己在 AWS 與 S3 的操作愈來愈有自信。
玩了一陣子之後,她決定 gim-test 這個桶已經不再適合她的 pipeline,想把它刪掉。
它開始像是多餘的負擔,Sam 不想讓它佔據她精心整理的桶清單。
她已經建立好 S3 的 boto3 用戶端,並指派給變數 s3。
請幫 Sam 做個清理,刪除 gim-test 這個桶。
本練習屬於課程
Python 中的 AWS Boto 入門
練習說明
- 刪除
'gim-test'桶。 - 從 S3 取得桶清單。
- 列印每個
'Buckets'的'Name'。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Delete the gim-test bucket
s3.____(____='gim-test')
# Get the list_buckets response
response = s3.____()
# Print each Buckets Name
for bucket in response['____']:
print(bucket['____'])