This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdevelopers.tf
104 lines (90 loc) · 3.21 KB
/
developers.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
resource "aws_iam_group" "developers" {
name = "developers"
}
resource "aws_iam_group_policy_attachment" "developers" {
group = aws_iam_group.developers.name
policy_arn = aws_iam_policy.enforce_mfa.arn
}
resource "aws_iam_policy" "enforce_mfa" {
name = "enforce_mfa"
description = "Enforces MFA and allows human users to manage their own credentials."
# https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_aws_my-sec-creds-self-manage.html
policy = file("files/aws_sec_creds_self_manage.json")
}
resource "aws_iam_group_policy_attachment" "developers_elb_full" {
group = aws_iam_group.developers.name
policy_arn = "arn:aws:iam::aws:policy/AmazonEC2FullAccess"
}
resource "aws_iam_group_policy_attachment" "developers_ec2_full" {
group = aws_iam_group.developers.name
policy_arn = "arn:aws:iam::aws:policy/AmazonEC2FullAccess"
}
resource "aws_iam_group_policy_attachment" "developers_efs_full" {
group = aws_iam_group.developers.name
policy_arn = "arn:aws:iam::aws:policy/AmazonElasticFileSystemFullAccess"
}
resource "aws_iam_group_policy_attachment" "developers_elasticache_full" {
group = aws_iam_group.developers.name
policy_arn = "arn:aws:iam::aws:policy/AmazonElastiCacheFullAccess"
}
resource "aws_iam_group_policy_attachment" "developers_iam_ro" {
group = aws_iam_group.developers.name
policy_arn = "arn:aws:iam::aws:policy/IAMReadOnlyAccess"
}
resource "aws_iam_group_policy_attachment" "developers_rds_full" {
group = aws_iam_group.developers.name
policy_arn = "arn:aws:iam::aws:policy/AmazonRDSFullAccess"
}
resource "aws_iam_group_policy_attachment" "developers_route53_full" {
group = aws_iam_group.developers.name
policy_arn = "arn:aws:iam::aws:policy/AmazonRoute53FullAccess"
}
resource "aws_iam_group_policy_attachment" "developers_s3_full" {
group = aws_iam_group.developers.name
policy_arn = "arn:aws:iam::aws:policy/AmazonS3FullAccess"
}
resource "aws_iam_group_policy_attachment" "developers_dynamodb_full" {
group = aws_iam_group.developers.name
policy_arn = "arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess"
}
resource "aws_iam_group_policy_attachment" "developers_acm_full" {
group = aws_iam_group.developers.name
policy_arn = "arn:aws:iam::aws:policy/AWSCertificateManagerFullAccess"
}
resource "aws_iam_group_policy" "developers_policy" {
name = "developers_policy"
group = aws_iam_group.developers.name
# Policy copied from CI user
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"iam:AddRoleToInstanceProfile",
"iam:AttachRolePolicy",
"iam:CreateInstanceProfile",
"iam:CreateRole",
"iam:DeleteInstanceProfile",
"iam:DeleteRole",
"iam:DeleteRolePolicy",
"iam:GetInstanceProfile",
"iam:GetRole",
"iam:GetRolePolicy",
"iam:ListAttachedRolePolicies",
"iam:ListInstanceProfiles",
"iam:ListInstanceProfilesForRole",
"iam:ListRolePolicies",
"iam:PassRole",
"iam:PutRolePolicy",
"iam:RemoveRoleFromInstanceProfile",
"iam:UpdateRole",
"sts:*"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
EOF
}