Terraform-provider-helm: Outputs..

Created on 4 Sep 2017  路  6Comments  路  Source: hashicorp/terraform-provider-helm

Hiya,

Just wondering how we can get outputs from charts for use with other terraform modules?

Say we deploy the influxdb helm chart - what would be the right syntax to use to get an output variable - like the IP address?

acknowledged enhancement needs-investigation

Most helpful comment

Are there plans to implement this anytime soon?

All 6 comments

The current outputs of the resource_chart are the information about the release itself, not about the different stuff deployed at k8s

So... We cannot automate anything? Like, we run multiple charts, then we need to manually take generated data and put it into terraform variables. Then.. Damn, so what is the purpose of this provider, if it cannot work in conjunction with other modules?

Are there plans to implement this anytime soon?

@iorlas You could use the kubernetes service data source https://www.terraform.io/docs/providers/kubernetes/d/service.html

We are having a problem that when the helm release resource is not even created then the kubernetes service is still successfully getting the helm releases' name (because its an input) and hence runs and errors with "service not found". However if this name was an output after helm release creation this would solve our problem

@mo-elsherif I think I solved your issue simply with a dependency statement, e.g.:

resource "helm_release" "postgres" {
  name             = "postgres"
  repository       = "https://charts.bitnami.com/bitnami"
  chart            = "postgresql"
  version          = "9.8.1"
}

data "kubernetes_service" "postgres" {
  depends_on = [helm_release.postgres]
  metadata {
    name = "postgres-postgresql"
  }
}
Was this page helpful?
0 / 5 - 0 ratings