Before deleting S3 bucket, you need to delete every objects in the bucket.
But if you have many objects in the S3 bucket, it will take time to delete them by the management console.
In this case, CLI deletion is very effective to save your time.
By executing “aws s3 rm” command, you can delete objects by applying regular expression.
Before I actually execute this command, I applied dryrun option. You can check delete target objects in advance.
Check if delete target objects are correct.
If it is OK, let’s execute “aws s3 rm” command without dryrun option.
OK, the command is completed without any errors.
Let’s check the existence of objects in the management console just to be safe.
OK, every objects are deleted completely !!