Skip to content

Commit

Permalink
feat: add standard variables and variable to add labels to Argo CD app
Browse files Browse the repository at this point in the history
  • Loading branch information
lentidas committed Sep 15, 2023
1 parent b855dca commit f63119d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions aks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module "thanos" {
base_domain = var.base_domain
argocd_namespace = var.argocd_namespace
argocd_project = var.argocd_project
argocd_labels = var.argocd_labels
destination_cluster = var.destination_cluster
target_revision = var.target_revision
cluster_issuer = var.cluster_issuer
Expand Down
1 change: 1 addition & 0 deletions eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module "thanos" {
base_domain = var.base_domain
argocd_namespace = var.argocd_namespace
argocd_project = var.argocd_project
argocd_labels = var.argocd_labels
destination_cluster = var.destination_cluster
target_revision = var.target_revision
cluster_issuer = var.cluster_issuer
Expand Down
1 change: 1 addition & 0 deletions kind/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module "thanos" {
base_domain = var.base_domain
argocd_namespace = var.argocd_namespace
argocd_project = var.argocd_project
argocd_labels = var.argocd_labels
destination_cluster = var.destination_cluster
target_revision = var.target_revision
cluster_issuer = var.cluster_issuer
Expand Down
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ resource "argocd_application" "this" {
metadata {
name = var.destination_cluster != "in-cluster" ? "thanos-${var.destination_cluster}" : "thanos"
namespace = var.argocd_namespace
labels = merge({
"application" = "thanos"
"cluster" = var.destination_cluster
}, var.argocd_labels)
}

timeouts {
Expand Down
1 change: 1 addition & 0 deletions sks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module "thanos" {
base_domain = var.base_domain
argocd_namespace = var.argocd_namespace
argocd_project = var.argocd_project
argocd_labels = var.argocd_labels
destination_cluster = var.destination_cluster
target_revision = var.target_revision
cluster_issuer = var.cluster_issuer
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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
Expand Down

0 comments on commit f63119d

Please sign in to comment.