I’m quite new to terraform so my problem might be naive but still, I do not know how to solve it.
I have a terraform script that uses helm_release (https://www.terraform.io/docs/providers/helm/r/release.html) problem is that I have deployment configuration in a separate git repository. Let’s say: https://project.git/configuration.
What I would like to achieve is to be able to add all files from e.g. https://project.git/configuration/dev (for dev env deployment) to config map.
The structure of terraform module is:
+project
+-helm
+--templates
+---configmap.yaml
+---deployment.yaml
+---ingress.yaml
+---service.yaml
+--chart.yaml
+--values.yaml
+-helm.tf
+-other tf files
I need all files from the configuration repository to be placed under
+project
+-helm
+--configuration
As only then I’m able to use this:
apiVersion: v1
kind: ConfigMap
metadata:
...
data:
{{- (.Files.Glob "configuration/*").AsConfig | nindent 2 }}
in my configmap.yaml, the helm requires those files to be placed in chart directory.
I’m also keen of making https://project.git/configuration a terraform module. So I can use it as a submodule. But the problem remains the same, how to make those files available in project/helm/configuration