Skip to content

Commit 60c350a

Browse files
authored
Merge pull request #39 from DNXLabs/feature/upgrade-iam
Updating iam policy for supporting newer charts
2 parents 266ca73 + 371cea2 commit 60c350a

File tree

3 files changed

+30
-32
lines changed

3 files changed

+30
-32
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module "load_balancer_controller" {
5151
| helm\_chart\_name | AWS Load Balancer Controller Helm chart name. | `string` | `"aws-load-balancer-controller"` | no |
5252
| helm\_chart\_release\_name | AWS Load Balancer Controller Helm chart release name. | `string` | `"aws-load-balancer-controller"` | no |
5353
| helm\_chart\_repo | AWS Load Balancer Controller Helm repository name. | `string` | `"https://aws.github.io/eks-charts"` | no |
54-
| helm\_chart\_version | AWS Load Balancer Controller Helm chart version. | `string` | `"1.4.4"` | no |
54+
| helm\_chart\_version | AWS Load Balancer Controller Helm chart version. | `string` | `"1.10.1"` | no |
5555
| mod\_dependency | Dependence variable binds all AWS resources allocated by this module, dependent modules reference this variable. | `any` | `null` | no |
5656
| namespace | AWS Load Balancer Controller Helm chart namespace which the service will be created. | `string` | `"kube-system"` | no |
5757
| permissions\_boundary | If provided, all IAM roles will be created with this permissions boundary attached. | `string` | `null` | no |

_variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ variable "helm_chart_repo" {
3939

4040
variable "helm_chart_version" {
4141
type = string
42-
default = "1.4.4"
42+
default = "1.10.1"
4343
description = "AWS Load Balancer Controller Helm chart version."
4444
}
4545

@@ -105,4 +105,4 @@ variable "tags" {
105105
type = map(string)
106106
default = null
107107
description = "Optional Parameter to add tags to the lb IAM role"
108-
}
108+
}

iam.tf

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ data "aws_iam_policy_document" "lb_controller" {
4242
"ec2:DescribeTags",
4343
"ec2:GetCoipPoolUsage",
4444
"ec2:DescribeCoipPools",
45+
"ec2:GetSecurityGroupsForVpc",
4546
"elasticloadbalancing:DescribeLoadBalancers",
4647
"elasticloadbalancing:DescribeLoadBalancerAttributes",
4748
"elasticloadbalancing:DescribeListeners",
@@ -51,7 +52,9 @@ data "aws_iam_policy_document" "lb_controller" {
5152
"elasticloadbalancing:DescribeTargetGroups",
5253
"elasticloadbalancing:DescribeTargetGroupAttributes",
5354
"elasticloadbalancing:DescribeTargetHealth",
54-
"elasticloadbalancing:DescribeTags"
55+
"elasticloadbalancing:DescribeTags",
56+
"elasticloadbalancing:DescribeTrustStores",
57+
"elasticloadbalancing:DescribeListenerAttributes"
5558
]
5659
resources = [
5760
"*",
@@ -272,6 +275,29 @@ data "aws_iam_policy_document" "lb_controller" {
272275
effect = "Allow"
273276
}
274277

278+
statement {
279+
actions = [
280+
"elasticloadbalancing:ModifyLoadBalancerAttributes",
281+
"elasticloadbalancing:SetIpAddressType",
282+
"elasticloadbalancing:SetSecurityGroups",
283+
"elasticloadbalancing:SetSubnets",
284+
"elasticloadbalancing:DeleteLoadBalancer",
285+
"elasticloadbalancing:ModifyTargetGroup",
286+
"elasticloadbalancing:ModifyTargetGroupAttributes",
287+
"elasticloadbalancing:DeleteTargetGroup",
288+
"elasticloadbalancing:ModifyListenerAttributes"
289+
]
290+
resources = ["*"]
291+
condition {
292+
test = "Null"
293+
variable = "aws:ResourceTag/elbv2.k8s.aws/cluster"
294+
295+
values = [
296+
"false"
297+
]
298+
}
299+
}
300+
275301
statement {
276302
actions = [
277303
"elasticloadbalancing:AddTags"
@@ -305,34 +331,6 @@ data "aws_iam_policy_document" "lb_controller" {
305331
effect = "Allow"
306332
}
307333

308-
statement {
309-
actions = [
310-
"elasticloadbalancing:ModifyLoadBalancerAttributes",
311-
"elasticloadbalancing:SetIpAddressType",
312-
"elasticloadbalancing:SetSecurityGroups",
313-
"elasticloadbalancing:SetSubnets",
314-
"elasticloadbalancing:DeleteLoadBalancer",
315-
"elasticloadbalancing:ModifyTargetGroup",
316-
"elasticloadbalancing:ModifyTargetGroupAttributes",
317-
"elasticloadbalancing:DeleteTargetGroup"
318-
]
319-
320-
resources = [
321-
"*"
322-
]
323-
324-
condition {
325-
test = "Null"
326-
variable = "aws:ResourceTag/elbv2.k8s.aws/cluster"
327-
328-
values = [
329-
"false"
330-
]
331-
}
332-
333-
effect = "Allow"
334-
}
335-
336334
statement {
337335
actions = [
338336
"elasticloadbalancing:RegisterTargets",

0 commit comments

Comments
 (0)