-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgroups.tf
51 lines (40 loc) · 1.88 KB
/
groups.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# An IAM group for assessment environment provisioners.
resource "aws_iam_group" "assessment_provisioners" {
provider = aws.users
name = var.assessment_provisioners_group_name
}
# Attach the policy that allows assumption of all assessment roles
# needed in order to provision assessment environments.
resource "aws_iam_group_policy_attachment" "assessment_provisioners_base" {
provider = aws.users
group = aws_iam_group.assessment_provisioners.name
policy_arn = aws_iam_policy.provision_assessment_base.arn
}
# Attach the policy that allows assumption of all non-assessment roles
# needed in order to provision assessment environments.
resource "aws_iam_group_policy_attachment" "assessment_provisioners_backend" {
provider = aws.users
group = aws_iam_group.assessment_provisioners.name
policy_arn = aws_iam_policy.provision_assessment_backend.arn
}
# An IAM group for assessment environment provisioners without general
# access to the Terraform backend.
resource "aws_iam_group" "assessment_provisioners_no_backend" {
provider = aws.users
name = var.assessment_provisioners_no_backend_group_name
}
# Attach the policy that allows assumption of all assessment roles
# needed in order to provision assessment environments.
resource "aws_iam_group_policy_attachment" "assessment_provisioners_no_backend_base" {
provider = aws.users
group = aws_iam_group.assessment_provisioners_no_backend.name
policy_arn = aws_iam_policy.provision_assessment_base.arn
}
# Attach the policy that allows assumption of all non-assessment roles
# needed in order to provision assessment environments, with the
# exception of Terraform backend access.
resource "aws_iam_group_policy_attachment" "assessment_provisioners_no_backend" {
provider = aws.users
group = aws_iam_group.assessment_provisioners_no_backend.name
policy_arn = aws_iam_policy.provision_assessment_no_backend.arn
}