-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.tf
61 lines (60 loc) · 1.85 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
resource "kubernetes_manifest" "argo_application" {
computed_fields = [
"metadata.labels",
"metadata.annotations",
"metadata.finalizers",
"spec.source.helm.version"
]
field_manager {
# force field manager conflicts to be overridden
force_conflicts = true
}
manifest = {
apiVersion = "argoproj.io/v1alpha1"
kind = "Application"
metadata = {
name = var.name
namespace = var.argocd_namespace
labels = local.labels
finalizers = var.cascade_delete == true ? ["resources-finalizer.argocd.argoproj.io"] : []
}
spec = {
project = var.project
source = {
repoURL = var.repo_url
targetRevision = var.target_revision
chart = var.chart
path = var.path
helm = {
releaseName = var.release_name == null ? var.name : var.release_name
parameters = local.helm_parameters
values = yamlencode(merge({ labels = local.labels }, var.helm_values))
}
}
destination = {
server = var.destination_server
namespace = var.namespace
}
ignoreDifferences = var.ignore_differences
syncPolicy = {
automated = {
prune = var.automated_prune
selfHeal = var.automated_self_heal
}
syncOptions = concat(var.sync_options, [
var.sync_option_validate ? "Validate=true" : "Validate=false",
var.sync_option_create_namespace ? "CreateNamespace=true" : "CreateNamespace=false",
])
retry = {
limit = var.retry_limit
backoff = {
duration = var.retry_backoff_duration
factor = var.retry_backoff_factor
maxDuration = var.retry_backoff_max_duration
}
}
}
ignoreDifferences = var.ignore_differences
}
}
}