Skip to content

Commit

Permalink
update(aws-load-balancer-controller): update iam policy
Browse files Browse the repository at this point in the history
Signed-off-by: Aldo Lacuku <[email protected]>
  • Loading branch information
alacuku committed Jul 17, 2024
1 parent 0d37160 commit 4bb73c3
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions config/clusters/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ data "aws_iam_policy_document" "loadbalancer_controller" {
"elasticloadbalancing:DescribeTargetGroupAttributes",
"elasticloadbalancing:DescribeTargetHealth",
"elasticloadbalancing:DescribeTags",
"elasticloadbalancing:DescribeTrustStores",
]
}

Expand Down Expand Up @@ -915,7 +916,6 @@ data "aws_iam_policy_document" "loadbalancer_controller" {
}

statement {
sid = ""
effect = "Allow"

resources = [
Expand Down Expand Up @@ -943,7 +943,6 @@ data "aws_iam_policy_document" "loadbalancer_controller" {
}

statement {
sid = ""
effect = "Allow"

resources = [
Expand All @@ -960,7 +959,28 @@ data "aws_iam_policy_document" "loadbalancer_controller" {
}

statement {
sid = ""
effect = "Allow"
resources = ["*"]

actions = [
"elasticloadbalancing:ModifyLoadBalancerAttributes",
"elasticloadbalancing:SetIpAddressType",
"elasticloadbalancing:SetSecurityGroups",
"elasticloadbalancing:SetSubnets",
"elasticloadbalancing:DeleteLoadBalancer",
"elasticloadbalancing:ModifyTargetGroup",
"elasticloadbalancing:ModifyTargetGroupAttributes",
"elasticloadbalancing:DeleteTargetGroup",
]

condition {
test = "Null"
variable = "aws:ResourceTag/elbv2.k8s.aws/cluster"
values = ["false"]
}
}

statement {
effect = "Allow"

resources = [
Expand Down Expand Up @@ -988,28 +1008,6 @@ data "aws_iam_policy_document" "loadbalancer_controller" {
}
}

statement {
effect = "Allow"
resources = ["*"]

actions = [
"elasticloadbalancing:ModifyLoadBalancerAttributes",
"elasticloadbalancing:SetIpAddressType",
"elasticloadbalancing:SetSecurityGroups",
"elasticloadbalancing:SetSubnets",
"elasticloadbalancing:DeleteLoadBalancer",
"elasticloadbalancing:ModifyTargetGroup",
"elasticloadbalancing:ModifyTargetGroupAttributes",
"elasticloadbalancing:DeleteTargetGroup",
]

condition {
test = "Null"
variable = "aws:ResourceTag/elbv2.k8s.aws/cluster"
values = ["false"]
}
}

statement {
effect = "Allow"
resources = ["arn:aws:elasticloadbalancing:*:*:targetgroup/*/*"]
Expand Down

0 comments on commit 4bb73c3

Please sign in to comment.