forked from particuleio/terraform-kubernetes-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
secrets-store-csi-driver-provider-aws.tf
31 lines (26 loc) · 1.32 KB
/
secrets-store-csi-driver-provider-aws.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
locals {
secrets-store-csi-driver-provider-aws = merge(
{
enabled = local.secrets-store-csi-driver.enabled
url = "https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/main/deployment/aws-provider-installer.yaml"
},
var.secrets-store-csi-driver-provider-aws
)
secrets-store-csi-driver-provider-aws_apply = local.secrets-store-csi-driver-provider-aws.enabled ? [for v in data.kubectl_file_documents.secrets-store-csi-driver-provider-aws.0.documents : {
data : yamldecode(v)
content : v
}
] : null
}
data "http" "secrets-store-csi-driver-provider-aws" {
count = local.secrets-store-csi-driver-provider-aws.enabled ? 1 : 0
url = local.secrets-store-csi-driver-provider-aws.url
}
data "kubectl_file_documents" "secrets-store-csi-driver-provider-aws" {
count = local.secrets-store-csi-driver-provider-aws.enabled ? 1 : 0
content = data.http.secrets-store-csi-driver-provider-aws[0].response_body
}
resource "kubectl_manifest" "secrets-store-csi-driver-provider-aws" {
for_each = local.secrets-store-csi-driver-provider-aws.enabled ? { for v in local.secrets-store-csi-driver-provider-aws_apply : lower(join("/", compact([v.data.apiVersion, v.data.kind, lookup(v.data.metadata, "namespace", ""), v.data.metadata.name]))) => v.content } : {}
yaml_body = each.value
}