Skip to content

Commit e1403c1

Browse files
authored
feat: Add elasticloadbalancing:AddTags permissions to AWS Load Balancer Controller policy required for version 2.4.7+ (#358)
1 parent 80c5a46 commit e1403c1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

modules/iam-role-for-service-accounts-eks/policies.tf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,32 @@ data "aws_iam_policy_document" "load_balancer_controller" {
875875
}
876876
}
877877

878+
statement {
879+
actions = [
880+
"elasticloadbalancing:AddTags"
881+
]
882+
resources = [
883+
"arn:${local.partition}:elasticloadbalancing:*:*:targetgroup/*/*",
884+
"arn:${local.partition}:elasticloadbalancing:*:*:loadbalancer/net/*/*",
885+
"arn:${local.partition}:elasticloadbalancing:*:*:loadbalancer/app/*/*",
886+
]
887+
888+
condition {
889+
test = "StringEquals"
890+
variable = "elasticloadbalancing:CreateAction"
891+
values = [
892+
"CreateTargetGroup",
893+
"CreateLoadBalancer",
894+
]
895+
}
896+
897+
condition {
898+
test = "Null"
899+
variable = "aws:RequestTag/elbv2.k8s.aws/cluster"
900+
values = ["false"]
901+
}
902+
}
903+
878904
statement {
879905
actions = [
880906
"elasticloadbalancing:RegisterTargets",

0 commit comments

Comments
 (0)