-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.tf
40 lines (38 loc) · 1.04 KB
/
main.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
resource "humanitec_resource_definition" "main" {
id = "${var.prefix}k8s-service-account"
name = "${var.prefix}k8s-service-account"
type = "k8s-service-account"
driver_type = "humanitec/template"
driver_inputs = {
values_string = jsonencode({
templates = {
# cookie = ""
init = ""
manifests = <<EOL
serviceaccount.yaml:
data:
apiVersion: v1
kind: ServiceAccount
metadata:
name: $${resources['azure-managed-identity'].outputs.principal_id}
annotations:
azure.workload.identity/client-id: $${resources['azure-managed-identity'].outputs.client_id}
context: {{trimPrefix "modules." "$${context.res.id}"}}
res: $${context.res.id}
app: $${context.app.id}
env: $${context.env.id}
location: namespace
EOL
outputs = <<EOL
name: $${resources['azure-managed-identity'].outputs.principal_id}
EOL
}
})
}
provision = {
"azure-federated-identity" = {
match_dependents = false
is_dependent = true
}
}
}