diff --git a/README.adoc b/README.adoc index ffbf54d4..4c30f640 100644 --- a/README.adoc +++ b/README.adoc @@ -68,6 +68,30 @@ Type: `any` Default: `{}` +==== [[input_app_autosync]] <> + +Description: Automated sync options for the Argo CD Application resource. + +Type: +[source,hcl] +---- +object({ + allow_empty = optional(bool) + prune = optional(bool) + self_heal = optional(bool) + }) +---- + +Default: +[source,json] +---- +{ + "allow_empty": false, + "prune": true, + "self_heal": true +} +---- + ==== [[input_cluster_issuer]] <> Description: n/a @@ -130,7 +154,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v1.0.0-alpha.2"` +Default: `"v1.0.0-alpha.3"` === Outputs @@ -201,6 +225,32 @@ Description: n/a |`{}` |no +|[[input_app_autosync]] <> +|Automated sync options for the Argo CD Application resource. +| + +[source] +---- +object({ + allow_empty = optional(bool) + prune = optional(bool) + self_heal = optional(bool) + }) +---- + +| + +[source] +---- +{ + "allow_empty": false, + "prune": true, + "self_heal": true +} +---- + +|no + |[[input_argocd_namespace]] <> |n/a |`string` @@ -264,7 +314,7 @@ Description: n/a |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v1.0.0-alpha.2"` +|`"v1.0.0-alpha.3"` |no |=== diff --git a/aks/README.adoc b/aks/README.adoc index 647949e7..a156f453 100644 --- a/aks/README.adoc +++ b/aks/README.adoc @@ -66,6 +66,30 @@ Type: `any` Default: `{}` +==== [[input_app_autosync]] <> + +Description: Automated sync options for the Argo CD Application resource. + +Type: +[source,hcl] +---- +object({ + allow_empty = optional(bool) + prune = optional(bool) + self_heal = optional(bool) + }) +---- + +Default: +[source,json] +---- +{ + "allow_empty": false, + "prune": true, + "self_heal": true +} +---- + ==== [[input_cluster_issuer]] <> Description: n/a @@ -144,7 +168,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v1.0.0-alpha.2"` +Default: `"v1.0.0-alpha.3"` === Outputs @@ -193,6 +217,32 @@ Description: n/a |`{}` |no +|[[input_app_autosync]] <> +|Automated sync options for the Argo CD Application resource. +| + +[source] +---- +object({ + allow_empty = optional(bool) + prune = optional(bool) + self_heal = optional(bool) + }) +---- + +| + +[source] +---- +{ + "allow_empty": false, + "prune": true, + "self_heal": true +} +---- + +|no + |[[input_argocd_namespace]] <> |n/a |`string` @@ -278,7 +328,7 @@ object({ |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v1.0.0-alpha.2"` +|`"v1.0.0-alpha.3"` |no |=== diff --git a/aks/main.tf b/aks/main.tf index cce24d00..d4f5d909 100644 --- a/aks/main.tf +++ b/aks/main.tf @@ -12,10 +12,12 @@ module "kube-prometheus-stack" { source = "../" cluster_name = var.cluster_name - argocd_namespace = var.argocd_namespace base_domain = var.base_domain + argocd_namespace = var.argocd_namespace + target_revision = var.target_revision cluster_issuer = var.cluster_issuer namespace = var.namespace + app_autosync = var.app_autosync dependency_ids = var.dependency_ids prometheus = var.prometheus diff --git a/eks/README.adoc b/eks/README.adoc index 8e151592..da7cd341 100644 --- a/eks/README.adoc +++ b/eks/README.adoc @@ -55,6 +55,30 @@ Type: `any` Default: `{}` +==== [[input_app_autosync]] <> + +Description: Automated sync options for the Argo CD Application resource. + +Type: +[source,hcl] +---- +object({ + allow_empty = optional(bool) + prune = optional(bool) + self_heal = optional(bool) + }) +---- + +Default: +[source,json] +---- +{ + "allow_empty": false, + "prune": true, + "self_heal": true +} +---- + ==== [[input_cluster_issuer]] <> Description: n/a @@ -133,7 +157,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v1.0.0-alpha.2"` +Default: `"v1.0.0-alpha.3"` === Outputs @@ -181,6 +205,32 @@ Description: n/a |`{}` |no +|[[input_app_autosync]] <> +|Automated sync options for the Argo CD Application resource. +| + +[source] +---- +object({ + allow_empty = optional(bool) + prune = optional(bool) + self_heal = optional(bool) + }) +---- + +| + +[source] +---- +{ + "allow_empty": false, + "prune": true, + "self_heal": true +} +---- + +|no + |[[input_argocd_namespace]] <> |n/a |`string` @@ -260,7 +310,7 @@ object({ |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v1.0.0-alpha.2"` +|`"v1.0.0-alpha.3"` |no |=== diff --git a/eks/main.tf b/eks/main.tf index 0d803669..d5d9a8a8 100644 --- a/eks/main.tf +++ b/eks/main.tf @@ -2,10 +2,12 @@ module "kube-prometheus-stack" { source = "../" cluster_name = var.cluster_name - argocd_namespace = var.argocd_namespace base_domain = var.base_domain + argocd_namespace = var.argocd_namespace + target_revision = var.target_revision cluster_issuer = var.cluster_issuer namespace = var.namespace + app_autosync = var.app_autosync dependency_ids = var.dependency_ids prometheus = var.prometheus diff --git a/kind/main.tf b/kind/main.tf index 39ecda12..535a7340 100644 --- a/kind/main.tf +++ b/kind/main.tf @@ -2,10 +2,12 @@ module "kube-prometheus-stack" { source = "../" cluster_name = var.cluster_name - argocd_namespace = var.argocd_namespace base_domain = var.base_domain + argocd_namespace = var.argocd_namespace + target_revision = var.target_revision cluster_issuer = var.cluster_issuer namespace = var.namespace + app_autosync = var.app_autosync dependency_ids = var.dependency_ids prometheus = var.prometheus diff --git a/main.tf b/main.tf index 9b1fbb67..1a41158b 100644 --- a/main.tf +++ b/main.tf @@ -79,7 +79,7 @@ resource "argocd_application" "this" { delete = "15m" } - wait = true + wait = var.app_autosync == { "allow_empty" = tobool(null), "prune" = tobool(null), "self_heal" = tobool(null) } ? false : true spec { project = argocd_project.this.metadata.0.name @@ -103,11 +103,7 @@ resource "argocd_application" "this" { } sync_policy { - automated = { - allow_empty = false - prune = true - self_heal = true - } + automated = var.app_autosync retry { backoff = { diff --git a/variables.tf b/variables.tf index db642a7a..cd9c44f9 100644 --- a/variables.tf +++ b/variables.tf @@ -36,6 +36,20 @@ variable "helm_values" { default = [] } +variable "app_autosync" { + description = "Automated sync options for the Argo CD Application resource." + type = object({ + allow_empty = optional(bool) + prune = optional(bool) + self_heal = optional(bool) + }) + default = { + allow_empty = false + prune = true + self_heal = true + } +} + variable "dependency_ids" { type = map(string) default = {}