Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions topics/aws/exercises/create_user/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,37 @@ As you probably know at this point, it's not recommended to work with the root a
10. Click on "Next: Tags"
11. Add a tag with the key `Role` and the value `DevOps`
12. Click on "Review" and then create on "Create user"

13. ### Solution using Terraform

```

resource "aws_iam_group_membership" "team" {
name = "tf-testing-group-membership"

users = [
aws_iam_user.newuser.name,

]

group = aws_iam_group.admin.name
}

resource "aws_iam_group_policy_attachment" "test-attach" {
group = aws_iam_group.admin.name
policy_arn = "arn:aws:iam::aws:policy/AdministratorAccess"
}
resource "aws_iam_group" "admin" {
name = "admin"
}

resource "aws_iam_user" "newuser" {
name = "newuser"
path = "/system/"

tags = {
Role = "DevOps"
}
}
```

14 changes: 14 additions & 0 deletions topics/aws/exercises/password_policy_and_mfa/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,17 @@ MFA:
3. Expand "Multi-factor authentication (MFA)" and click on "Activate MFA"
4. Choose one of the devices
5. Follow the instructions to set it up and click on "Assign MFA"

6. ### Solution using Terraform:

```
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.