Date: March 17, 2022 Categories: Development Tags: aws, s3 Comments: 0 Delete all s3 buckets that contain string function cleanup_buckets { local dry=true; for line in `aws s3 ls`;do if [[ "$line" =~ "wla" ]];then echo $line; if [ "$dry" != "true" ];then aws s3 rm --recursive s3://$line aws s3 rb s3://$line fi fi done } Leave a Reply Cancel replyYour email address will not be published.Comment Name Email Website Save my name, email, and website in this browser for the next time I comment.