-
Notifications
You must be signed in to change notification settings - Fork 0
/
psk-aws-control-plane-base-role.tf
174 lines (169 loc) · 5.87 KB
/
psk-aws-control-plane-base-role.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# PSKControlPlaneBaseRole
#
# Used by: psk-aws-control-plane-base pipeline
# manages platform cluster aws-managed aspects
module "PSKControlPlaneBaseRole" {
source = "terraform-aws-modules/iam/aws//modules/iam-assumable-role"
version = "5.39.0"
create_role = true
role_name = "PSKControlPlaneBaseRole"
role_path = "/PSKRoles/"
role_requires_mfa = false
custom_role_policy_arns = [aws_iam_policy.PSKControlPlaneBaseRolePolicy.arn]
number_of_custom_role_policy_arns = 1
trusted_role_arns = ["arn:aws:iam::${var.state_account_id}:root"]
}
# role permissions
resource "aws_iam_policy" "PSKControlPlaneBaseRolePolicy" {
name = "PSKControlPlaneBaseRolePolicy"
path = "/PSKPolicies/"
policy = jsonencode({
"Version" : "2012-10-17"
"Statement" : [
{
"Action" : [
"route53:AssociateVPCWithHostedZone",
"route53:ChangeResourceRecordSets",
"route53:ChangeTagsForResource",
"route53:GetChange",
"route53:CreateHealthCheck",
"route53:CreateHostedZone",
"route53:CreateKeySigningKey",
"route53:CreateVPCAssociationAuthorization",
"route53:DeactivateKeySigningKey",
"route53:DeleteHealthCheck",
"route53:DeleteHostedZone",
"route53:DeleteKeySigningKey",
"route53:DeleteVPCAssociationAuthorization",
"route53:DisassociateVPCFromHostedZone",
"route53:GetHostedZone",
"route53:GetHostedZoneCount",
"route53:GetHostedZoneLimit",
"route53:ListHostedZones",
"route53:ListHostedZonesByName",
"route53:ListHostedZonesByVPC",
"route53:ListResourceRecordSets",
"route53:ListTagsForResource",
"route53:ListTagsForResources",
"route53:ListVPCAssociationAuthorizations",
"route53:UpdateHostedZoneComment",
"autoscaling:AttachInstances",
"autoscaling:CreateAutoScalingGroup",
"autoscaling:CreateLaunchConfiguration",
"autoscaling:CreateOrUpdateTags",
"autoscaling:DeleteAutoScalingGroup",
"autoscaling:DeleteLaunchConfiguration",
"autoscaling:DeleteTags",
"autoscaling:Describe*",
"autoscaling:DetachInstances",
"autoscaling:SetDesiredCapacity",
"autoscaling:UpdateAutoScalingGroup",
"autoscaling:SuspendProcesses",
"ec2:*Console*",
"ec2:Describe*",
"ec2:*NetworkAclEntry",
"ec2:*SecurityGroup*",
"ec2:*KeyPair",
"ec2:*LaunchTemplate*",
"ec2:*NetworkInterface*",
"ec2:*Image*",
"ec2:*Placement*",
"ec2:*Snapshot*",
"ec2:*Tags",
"ec2:*Volume*",
"ec2:*InstanceProfile*",
"ec2:AssignPrivateIpAddresses",
"ec2:AssociateRouteTable",
"ec2:CancelConversionTask",
"ec2:CancelImportTask",
"ec2:ConfirmProductInstance",
"ec2:Import*",
"ec2:ModifyInstance*",
"ec2:MonitorInstances",
"ec2:RebootInstances",
"ec2:ReportInstanceStatus",
"ec2:ResetInstanceAttribute",
"ec2:RunInstances",
"ec2:StartInstances",
"ec2:StopInstances",
"ec2:TerminateInstances",
"ec2:UnassignPrivateIpAddresses",
"ec2:UnmonitorInstances",
"ec2-instance-connect:SendSerial*",
"ec2:ModifyTrafficMirror*",
"ec2:DeleteTrafficMirror*",
"elasticloadbalancing:DescribeLoadBalancers",
"elasticloadbalancing:DescribeTags",
"elasticloadbalancing:DescribeLoadBalancerAttributes",
"elasticfilesystem:*Backup*",
"elasticfilesystem:*FileSystem*",
"elasticfilesystem:*Mount*",
"elasticfilesystem:*Tag*",
"elasticfilesystem:*Untag*",
"elasticfilesystem:Describe*",
"elasticfilesystem:*LifecycleConfiguration",
"ec2:CreateNetworkInterface",
"ec2:DescribeNetworkInterfaces",
"ec2:DescribeSubnets",
"eks:*",
"iam:AddClientIDToOpenIDConnectProvider",
"iam:AddRoleToInstanceProfile",
"iam:AttachRolePolicy",
"iam:CreateInstanceProfile",
"iam:CreateOpenIDConnectProvider",
"iam:CreateServiceLinkedRole",
"iam:CreatePolicy",
"iam:CreatePolicyVersion",
"iam:CreateRole",
"iam:*Addon",
"iam:DeleteInstanceProfile",
"iam:DeleteOpenIDConnectProvider",
"iam:DeletePolicy",
"iam:DeletePolicyVersion",
"iam:DeleteRole",
"iam:DeleteRolePolicy",
"iam:DeleteServiceLinkedRole",
"iam:DetachRolePolicy",
"iam:GetInstanceProfile",
"iam:GetOpenIDConnectProvider",
"iam:GetPolicy",
"iam:GetPolicyVersion",
"iam:GetRole",
"iam:GetRolePolicy",
"iam:List*",
"iam:PassRole",
"iam:PutRolePolicy",
"iam:Remove*",
"iam:Tag*",
"iam:Untag*",
"iam:Update*",
"logs:CreateLogGroup",
"logs:DescribeLogGroups",
"logs:DeleteLogGroup",
"logs:List*",
"logs:PutRetentionPolicy",
"logs:TagLogGroup",
"logs:UntagLogGroup",
"kms:CreateGrant",
"kms:CreateKey",
"kms:DeleteKey",
"kms:DescribeKey",
"kms:GetKeyPolicy",
"kms:GetKeyRotationStatus",
"kms:ListResourceTags",
"kms:ScheduleKeyDeletion",
"kms:EnableKeyRotation",
"kms:TagResource",
"kms:CreateAlias",
"kms:DeleteAlias",
"kms:ListAliases",
"ssm:GetParameter",
"sqs:*",
"events:*"
]
"Effect" : "Allow"
"Resource" : "*"
},
]
})
}