From 8ec1b9855973a15651ddefa6f31d1453a943e791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Heleno?= Date: Fri, 15 Sep 2023 14:18:08 +0200 Subject: [PATCH] feat: add standard variables and variable to add labels to Argo CD app --- main.tf | 4 ++++ variables.tf | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/main.tf b/main.tf index 4ab61dc..834a352 100644 --- a/main.tf +++ b/main.tf @@ -41,6 +41,10 @@ resource "argocd_application" "this" { metadata { name = var.destination_cluster != "in-cluster" ? "longhorn-${var.destination_cluster}" : "longhorn" namespace = var.argocd_namespace + labels = merge({ + "application" = "longhorn" + "cluster" = var.destination_cluster + }, var.argocd_labels) } timeouts { diff --git a/variables.tf b/variables.tf index 93cb9b4..6b3777d 100644 --- a/variables.tf +++ b/variables.tf @@ -32,6 +32,12 @@ variable "argocd_project" { default = null } +variable "argocd_labels" { + description = "Labels to attach to the Argo CD Application resource." + type = map(string) + default = {} +} + variable "destination_cluster" { description = "Destination cluster where the application should be deployed." type = string