ljfranklin / terraform-resource

A concourse resource to create infrastructure via Terraform
MIT License
185 stars 85 forks source link

Adding support for files on Vars input to an out call #168

Closed dumptruckman closed 2 years ago

dumptruckman commented 2 years ago

This allows you to specify a file path as the value for a var in vars. If the file path points to a file within the pipeline's workspace, it will load the contents of that file as the value of the variable. We have been using this for a while to pass the git ref from app-src/.git/short_ref into a terraform variable. It would be nice to see it merged into this repo unless you know of some other way to handle this particular use case.

dumptruckman commented 2 years ago

I pulled this from PR #72. The IAM stuff is not relevant anymore because the backend_config stuff does indeed work around the IAM issues. However, that PR had this tidbit about files in there and is the only thing holding me back from just using the original resource instead of our custom one.

dumptruckman commented 2 years ago

Well, I just discovered https://concourse-ci.org/load-var-step.html which I think does what I need without this PR. Going to look into it further and do some testing. If it does work as I think then I'll close this PR.

ljfranklin commented 2 years ago

@dumptruckman either the load_var step or setting put.params.var_files should work without this PR.