File tree Expand file tree Collapse file tree 5 files changed +32
-0
lines changed
Expand file tree Collapse file tree 5 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ module "eks" {
5656 ebs_csi_addon_version = var. ebs_csi_addon_version
5757 kube_proxy_addon_version = var. kube_proxy_addon_version
5858 admin_role_arns = data. aws_iam_roles . admin_arn . arns
59+ gha_role_arn = var. gha_role_arn
5960 subnet_ids = [
6061 module . vpc . private_subnets [0 ]. id ,
6162 module . vpc . private_subnets [1 ]. id ,
Original file line number Diff line number Diff line change @@ -286,3 +286,23 @@ resource "aws_eks_access_policy_association" "admin_policy" {
286286 aws_eks_access_entry . admin_role
287287 ]
288288}
289+
290+ resource "aws_eks_access_entry" "gha_role" {
291+ cluster_name = aws_eks_cluster. eks_cluster . name
292+ principal_arn = var. gha_role_arn
293+ type = " STANDARD"
294+ }
295+
296+ resource "aws_eks_access_policy_association" "gha_policy" {
297+ cluster_name = aws_eks_cluster. eks_cluster . name
298+ policy_arn = " arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy"
299+ principal_arn = var. gha_role_arn
300+
301+ access_scope {
302+ type = " cluster"
303+ }
304+
305+ depends_on = [
306+ aws_eks_access_entry . gha_role
307+ ]
308+ }
Original file line number Diff line number Diff line change @@ -44,3 +44,8 @@ variable "admin_role_arns" {
4444 type = set (string )
4545 description = " ARN of the Role used for admin cluster access."
4646}
47+
48+ variable "gha_role_arn" {
49+ type = string
50+ description = " ARN of the Role used for Github Actions."
51+ }
Original file line number Diff line number Diff line change @@ -283,3 +283,8 @@ variable "email_recipients" {
283283 description = " List of email addresses to contact in case an alert fails"
284284 default = []
285285}
286+
287+ variable "gha_role_arn" {
288+ type = string
289+ description = " ARN of the Role used for Github Actions."
290+ }
Original file line number Diff line number Diff line change @@ -26,3 +26,4 @@ gateway_node_group_desired_size = 0
2626hibernate = false
2727aq_bucket_cors_allowed_origin = " *"
2828deploy_sparkpost_templates = false
29+ gha_role_arn = " arn:aws:iam::842534099497:role/wri-api-dev-githubactions-role"
You can’t perform that action at this time.
0 commit comments