Articles → AWS → Enable MFA For S3 Bucket
Enable MFA For S3 Bucket
Purpose
Steps
- Create an S3 bucket
- Enable MFA for the account
- Enable transfer acceleration on the S3 bucket
- Write the command to enable MFA for the S3 bucket
- Output
Create An S3 Bucket
Click to Enlarge
Enable MFA For The Account
Enable Transfer Acceleration On The S3 Bucket
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 the Your Security Credentials section
Click to Enlarge
- Code → This is the six-digit code generated in the authenticator
Click to Enlarge
Output
Click to Enlarge
Disable MFA
{
"Bucket": "gyansangrah",
"VersioningConfiguration": {
"Status": "Suspended",
"MFADelete": "Disabled"
}
}
aws s3api put-bucket-versioning --bucket <bucket name> --cli-input-json <versioning-config.json file path> --mfa "<ARN_OF_MFA_DEVICE> <Code>"