-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
36 lines (33 loc) · 1.21 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
# Hack for module-to-module dependencies.
# https://github.com/hashicorp/terraform/issues/1178#issuecomment-449158607
# and
# https://github.com/hashicorp/terraform/issues/1178#issuecomment-473091030
# Make sure to add this null_resource.dependency_getter to the `depends_on`
# attribute to all resource(s) that will be constructed first within this
# module:
resource "null_resource" "dependency_getter" {
triggers = {
my_dependencies = "${join(",", var.dependencies)}"
}
}
data "helm_repository" "helm_repo" {
name = var.helm_repo.name
url = var.helm_repo.uri
}
resource "helm_release" "weavescope" {
depends_on = [null_resource.dependency_getter]
name = var.helm_release_name
chart = "weave-scope"
namespace = var.helm_namespace
version = var.helm_chart_version
values = trimspace(var.values) == "" && var.values == null ? [] : [var.values]
repository = data.helm_repository.helm_repo.metadata.0.name
}
resource "null_resource" "dependency_setter" {
# Hack for module-to-module dependencies.
# https://github.com/hashicorp/terraform/issues/1178#issuecomment-449158607
# List resource(s) that will be constructed last within the module.
depends_on = [
helm_release.weavescope
]
}