topics/aws/exercises/password_policy_and_mfa/solution.md
Note: DON'T perform this exercise unless you understand what you are doing and what is the outcome of applying these changes to your account
Create password policy with the following settings:
At least minimum 8 characters
At least one number
Prevent password reuse
Then enable MFA for the account.
Password Policy:
MFA:
Click on the account name
Click on "My Security Credentials"
Expand "Multi-factor authentication (MFA)" and click on "Activate MFA"
Choose one of the devices
Follow the instructions to set it up and click on "Assign MFA"
resource "aws_iam_account_password_policy" "strict" {
minimum_password_length = 8
require_numbers = true
allow_users_to_change_password = true
password_reuse_prevention = 1
}
Note: You cannot add MFA through terraform, you have to do it in the GUI.