Skip to content

Commit 5ef82fa

Browse files
authored
Merge pull request #12 from hackforla/cb/testuser
Creating users to test permissions and updating level 4 policy
2 parents e79f5cc + 8da07fb commit 5ef82fa

5 files changed

Lines changed: 63 additions & 27 deletions

File tree

terraform/aws-custom-policies.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module "aws_custom_policies" {
22
source = "./modules/aws-policies"
33
policies = {
4-
"IAMServicesAdmin" = {
4+
"IAMServicesSupervisor" = {
55
description = "Policy granting IAM services admins permissions to make changes to user accounts"
6-
filename = "level-4-iam-services-admin-policy.json"
6+
filename = "level-4-iam-services-supervisor-policy.json"
77
}
88
}
99
}

terraform/aws-custom-policies/level-4-iam-services-admin-policy.json

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"Statement": [
3+
{
4+
"Action": [
5+
"iam:CreateAccessKey"
6+
],
7+
"Effect": "Allow",
8+
"Resource": "arn:aws:iam::*:user/*"
9+
},
10+
{
11+
"Action": [
12+
"iam:UpdateLoginProfile"
13+
],
14+
"Condition": {
15+
"StringEquals": {
16+
"iam:ResourceTag/Access Level": [
17+
"1",
18+
"2"
19+
]
20+
}
21+
},
22+
"Effect": "Allow",
23+
"Resource": "arn:aws:iam::*:user/*"
24+
},
25+
{
26+
"Action": [
27+
"cloudshell:CreateEnvironment",
28+
"cloudshell:GetEnvironmentStatus",
29+
"cloudshell:CreateSession",
30+
"cloudshell:StartEnvironment",
31+
"cloudshell:StopEnvironment"
32+
],
33+
"Effect": "Allow",
34+
"Resource": "*"
35+
}
36+
],
37+
"Version": "2012-10-17"
38+
}

terraform/aws-groups.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module "iam_services_admin_group" {
1515

1616
group_name = "iam-services-admin-group"
1717
policy_arn = {
18-
"IAMServicesAdmin" = module.aws_custom_policies.policy_arns["IAMServicesAdmin"]
18+
"IAMServicesAdmin" = module.aws_custom_policies.policy_arns["IAMServicesSupervisor"]
1919
}
2020
}
2121

terraform/aws-users.tf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,26 @@ module "iam_user_awlFCCamp" {
8484
"Access Level" = "1"
8585
}
8686
user_groups = ["read-only-group"]
87+
}
88+
89+
module "iam_user_testiamuser" {
90+
source = "./modules/aws-users"
91+
92+
user_name = "testiamuser"
93+
user_tags = {
94+
"Project" = "devops-security"
95+
"Access Level" = "1"
96+
}
97+
user_groups = ["read-only-group"]
98+
}
99+
100+
module "iam_user_chelseyb" {
101+
source = "./modules/aws-users"
102+
103+
user_name = "chelseyb"
104+
user_tags = {
105+
"Project" = "devops-security"
106+
"Access Level" = "1"
107+
}
108+
user_groups = ["read-only-group", "iam-services-admin-group"]
87109
}

0 commit comments

Comments
 (0)