I have my helm_release
setup as the following:
resource "helm_release" "argocd" {
namespace = kubernetes_namespace.argocd.metadata.0.name
name = "argocd"
repository = "https://argoproj.github.io/argo-helm"
chart = "argo-cd"
version = var.argocd_chart_version
[...]
}
Now I want to add templates and triggers to the chart. I have them in argocd/triggers.yaml
and argocd/templates.yaml
. Example of triggers.yaml
(I have tried both with a trigger.
prefix and without):
trigger.on-created: |
- description: Application is created.
oncePer: app.metadata.name
send:
- app-created
when: "true"
trigger.on-deleted: |
- description: Application is deleted.
oncePer: app.metadata.name
send:
- app-deleted
when: app.metadata.deletionTimestamp != nil
The helm_release
set part is as follows:
set {
name = "notifications.triggers"
value = file("${path.module}/argocd/triggers.yaml")
}
However, this results in the following error:
│ Error: YAML parse error on argo-cd/templates/argocd-configs/argocd-notifications-cm.yaml: error converting YAML to JSON: yaml: line 30: could not find expected ':'
│
│ with module.prod.module.kubernetes.helm_release.argocd,
│ on moduleskubernetesargocd.tf line 19, in resource "helm_release" "argocd":
│ 19: resource "helm_release" "argocd" {
How do I set my triggers and templates correcly using Terraform? Preferably by loading the file but if I need to define then manually that is also doable.