Setup MFA Delete in S3 bucket
sajeedmoh
Posted on March 18, 2024
Setup MFA Delete in S3 bucket
Enabling MFA (Multi-Factor Authentication) delete functionality on an S3 bucket helps prevent accidental deletion of files.
Step to enable MFA delete on S3 bucket.
- Make sure S3 bucket version is enabled.
- Below CLI command to enable MFA delete
aws s3api put-bucket-versioning — bucket s3 bucket name — versioning-configuration Status=Enabled,MFADelete=Enabled — mfa “:aws:iam::(accountnumber):mfa/root-account-mfa-device (pass)”
(pass) -> This is six digit passcode from your MFA device configured.
Once MFA delete is enabled verify the settings inside S3 Bucket -> Properties -> Bucket Versioning.
- Test to delete version of an object and you will receive below error.
💖 💪 🙅 🚩
sajeedmoh
Posted on March 18, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.