Articles → AWS → Enable MFA For S3 Bucket
Enable MFA For S3 Bucket
Purpose
Steps
- Create a S3 bucket
- Enable MFA for the account
- Write command to enable MFA for S3 bucket
- Output
Create A S3 Bucket
Click to Enlarge
Enable MFA For The Account
Write Command To Enable MFA For S3 Bucket
aws s3api put-bucket-versioning --profile <Your_Profile> --bucket <Bucket_Name> --versioning-configuration Status=Enabled,MFADelete=Enabled --mfa "<ARN_OF_MFA_DEVICE> <Code>"
- Your_Profile → Your profile stored in "c:\users\< username >\.aws\config
Click to Enlarge
- Bucket_Name → The S3 bucket on which MFA will be enabled
- ARN_OF_MFA_DEVICE → This is the ARN of your MFA device. You can get this value from "Your Security Credentials" section
Click to Enlarge
- Code → This is the six-digit code generated in authenticator
Click to Enlarge
Output
Click to Enlarge
Disable MFA
aws s3api put-bucket-versioning --profile <Your_Profile> --bucket <Bucket_Name> --versioning-configuration Status=Disabled,MFADelete=Enabled --mfa "<ARN_OF_MFA_DEVICE> <Code>"