Skip to content

Commit e85bcc8

Browse files
committed
chore: add oidc roles
1 parent 0de5cfe commit e85bcc8

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

tests/uat/aws/account/federation.tf

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ data "aws_iam_policy_document" "github_actions_permissions" {
8686
"sts:GetAccessKeyInfo",
8787
"sts:GetCallerIdentity",
8888
"sts:GetFederationToken",
89-
"sts:TagSession"
89+
"sts:TagSession",
9090
]
9191
resources = ["*"]
9292
}
@@ -96,22 +96,23 @@ data "aws_iam_policy_document" "github_actions_permissions" {
9696
sid = "IAMPermissions"
9797
effect = "Allow"
9898
actions = [
99+
"iam:AddRoleToInstanceProfile",
100+
"iam:AttachRolePolicy",
101+
"iam:CreateInstanceProfile",
99102
"iam:CreateRole",
103+
"iam:DeleteInstanceProfile",
100104
"iam:DeleteRole",
105+
"iam:DetachRolePolicy",
106+
"iam:GetInstanceProfile",
107+
"iam:GetOpenIDConnectProvider",
101108
"iam:GetRole",
109+
"iam:ListAttachedRolePolicies",
102110
"iam:ListRoles",
111+
"iam:ListRoleTags",
103112
"iam:PassRole",
104-
"iam:AttachRolePolicy",
105-
"iam:DetachRolePolicy",
106-
"iam:ListAttachedRolePolicies",
107-
"iam:CreateInstanceProfile",
108-
"iam:DeleteInstanceProfile",
109-
"iam:GetInstanceProfile",
110-
"iam:AddRoleToInstanceProfile",
111113
"iam:RemoveRoleFromInstanceProfile",
112114
"iam:TagRole",
113115
"iam:UntagRole",
114-
"iam:ListRoleTags"
115116
]
116117
resources = ["*"]
117118
}
@@ -121,7 +122,7 @@ data "aws_iam_policy_document" "github_actions_permissions" {
121122
sid = "SSMNodePermissions"
122123
effect = "Allow"
123124
actions = [
124-
"ssm:GetParameter"
125+
"ssm:GetParameter",
125126
]
126127
resources = ["*"]
127128
}
@@ -130,39 +131,31 @@ data "aws_iam_policy_document" "github_actions_permissions" {
130131
statement {
131132
sid = "EKSClusterPermissions"
132133
effect = "Allow"
133-
actions = [
134-
"eks:*"
135-
]
134+
actions = ["eks:*"]
136135
resources = ["*"]
137136
}
138137

139138
# EC2 permissions for EKS
140139
statement {
141140
sid = "EC2Permissions"
142141
effect = "Allow"
143-
actions = [
144-
"ec2:*"
145-
]
142+
actions = ["ec2:*"]
146143
resources = ["*"]
147144
}
148145

149146
# CloudFormation permissions (EKS uses CloudFormation)
150147
statement {
151148
sid = "CloudFormationPermissions"
152149
effect = "Allow"
153-
actions = [
154-
"cloudformation:*"
155-
]
150+
actions = ["cloudformation:*"]
156151
resources = ["*"]
157152
}
158153

159154
# Auto Scaling permissions for EKS node groups
160155
statement {
161156
sid = "AutoScalingPermissions"
162157
effect = "Allow"
163-
actions = [
164-
"autoscaling:*"
165-
]
158+
actions = ["autoscaling:*"]
166159
resources = ["*"]
167160
}
168161
}

0 commit comments

Comments
 (0)