GalleyBytes / terraform-operator

A Kubernetes CRD to handle terraform operations
http://tf.galleybytes.com
Apache License 2.0
357 stars 47 forks source link

support templatefile #156

Open peetasan opened 10 months ago

peetasan commented 10 months ago

I'd like to use a file or templatefile function in my terraform code but the referenced file is not available for the apply step. How could I add my template(file)?

resource "some_resource" "my_resource" {
  config_json = templatefile("config.json", { uid = other_resource.arbitrary_resource.uid })
}
isaaguilar commented 10 months ago

There is a spec.setup.resourceDownloads that will download files into the main module's path by default, or a path relative to the main module: http://tf.galleybytes.com/docs/references/v0.13.0/#ResourceDownload_v1beta1_tf.galleybytes.com