Skip to content

Commit

Permalink
Fix Terraform dependencies
Browse files Browse the repository at this point in the history
  *Deployment was failing due to wrong deployment order

Signed-off-by: Nindemic <[email protected]>
  • Loading branch information
Nindemic committed Jan 10, 2022
1 parent 3bc199d commit 7f48a7b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
5 changes: 4 additions & 1 deletion 02_deployHono/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module "persistent_storage" {
}

module "kafka" {
depends_on = [module.persistent_storage]
depends_on = [module.persistent_storage, module.mongodb]
source = "./modules/kafka"
}

Expand Down Expand Up @@ -86,6 +86,9 @@ module "jaeger" {
depends_on = [module.k8s]
source = "./modules/jaeger"
}
module "cert_manager" {
source = "./modules/cert_manager"
}

###########################################
###########################################
Expand Down
13 changes: 13 additions & 0 deletions 02_deployHono/modules/cert_manager/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://github.com/jetstack/cert-manager/tree/614438aed00e1060870b273f2238794ef69b60ab/deploy/charts/cert-manager
resource "helm_release" "cert-manager" {
name = "cert-manager"

repository = "https://charts.jetstack.io"
chart = "cert-manager"
version = "~> 1.3.1"

set {
name = "installCRDs"
value = "true"
}
}
18 changes: 2 additions & 16 deletions 02_deployHono/modules/hono/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ resource "helm_release" "hono" {
chart = "hono"
version = "1.9.8"
cleanup_on_fail = "true"
#depends_on = [helm_release.mongodb]
depends_on = [helm_release.mongodb]
values = [
file("${path.module}/values.yaml")
]
Expand All @@ -48,18 +48,4 @@ resource "helm_release" "hono" {
name = "deviceRegistryExample.mongoDBBasedDeviceRegistry.mongodb.password"
value = var.mongodb_password
}
}
# https://github.com/jetstack/cert-manager/tree/614438aed00e1060870b273f2238794ef69b60ab/deploy/charts/cert-manager
resource "helm_release" "cert-manager" {
name = "cert-manager"

repository = "https://charts.jetstack.io"
chart = "cert-manager"
version = "~> 1.3.1"

set {
name = "installCRDs"
value = "true"
}
}

}

0 comments on commit 7f48a7b

Please sign in to comment.