-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontroller-keda.tf
More file actions
57 lines (47 loc) · 1.13 KB
/
controller-keda.tf
File metadata and controls
57 lines (47 loc) · 1.13 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
resource "helm_release" "keda" {
name = "keda"
chart = "keda"
repository = "https://kedacore.github.io/charts"
namespace = "keda"
version = "2.16.0"
create_namespace = true
set {
name = "serviceAccount.operator.annotations.eks\\.amazonaws\\.com/role-arn"
value = module.eks_keda_iam.iam_role_arn
}
depends_on = [
helm_release.ingress-nginx
]
}
module "eks_keda_iam" {
source = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"
version = "5.54.0"
role_name = "keda"
oidc_providers = {
ex = {
provider_arn = module.eks.oidc_provider_arn
namespace_service_accounts = ["keda:keda-operator"]
}
}
role_policy_arns = {
AmazonSQSFullAccess = aws_iam_policy.keda-policy.arn
}
}
resource "aws_iam_policy" "keda-policy" {
name = "keda-policy"
path = "/"
description = ""
policy = jsonencode({
"Statement" : [
{
"Action" : [
"sqs:GetQueueAttributes"
],
"Effect" : "Allow",
"Resource" : "*",
"Sid" : "SQS"
}
],
"Version" : "2012-10-17"
})
}