-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhelm_release_external_secrets.tf
43 lines (38 loc) · 1.26 KB
/
helm_release_external_secrets.tf
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
resource "helm_release" "external_secrets" {
name = "external-secrets"
chart = "external-secrets"
repository = "https://charts.external-secrets.io"
version = "0.10.0"
namespace = "external-secrets"
values = [
file("${path.module}/values/external-secrets-values.yaml")
]
depends_on = [kubernetes_namespace.external_secrets, aws_iam_policy.secret_reader_policy]
}
resource "aws_iam_policy" "secret_reader_policy" {
name = "SecretReaderPolicy"
description = "Allows external secrets operator to get secrets"
policy = jsonencode({
Version = "2012-10-17"
"Statement" : [
{
"Effect" : "Allow",
"Action" : [
"secretsmanager:GetRandomPassword",
"secretsmanager:GetResourcePolicy",
"secretsmanager:GetSecretValue",
"secretsmanager:DescribeSecret",
"secretsmanager:ListSecretVersionIds",
"secretsmanager:ListSecrets",
"secretsmanager:BatchGetSecretvalue"
],
"Resource" : ["*"]
}
]
})
}
resource "helm_release" "external_secrets_setup" {
name = "external-secrets-setup"
chart = "${path.module}/charts/external-secrets-setup"
depends_on = [helm_release.external_secrets]
}