-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaws-lb-controller.tf
More file actions
68 lines (55 loc) · 1.38 KB
/
aws-lb-controller.tf
File metadata and controls
68 lines (55 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
resource "helm_release" "alb-controller" {
depends_on = [module.eks.cluster_id]
name = "aws-load-balancer-controller"
chart = "aws-load-balancer-controller"
repository = "https://aws.github.io/eks-charts"
namespace = "kube-system"
dependency_update = true
set {
name = "clusterName"
value = module.eks.cluster_name
}
set {
name = "awsRegion"
value = var.region
}
set {
name = "region"
value = var.region
}
set {
name = "vpcId"
value = module.vpc.vpc_id
}
set {
name = "rbac.create"
value = "true"
}
set {
name = "serviceAccount.create"
value = "true"
}
set {
name = "serviceAccount.name"
value = "aws-load-balancer-controller"
}
set {
name = "serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn"
value = module.lb_role.iam_role_arn
}
set {
name = "enableServiceMutatorWebhook"
value = "false"
}
}
module "lb_role" {
source = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"
role_name = "${var.name_identifier}_eks_lb"
attach_load_balancer_controller_policy = true
oidc_providers = {
main = {
provider_arn = module.eks.oidc_provider_arn
namespace_service_accounts = ["kube-system:aws-load-balancer-controller"]
}
}
}