Open churnd opened 1 year ago
This is achievable today the way you can approach this is to just output a tfvars file into the checked out repo prior to configuration upload
@srlynch1 how to output an e.g. env/config.tfvars
file into the checked-out repo before configuration upload? I need to do for both terraform plan
and apply
You add a step to your pipeline to copy the config one directory up when the pipeline executes.
@churnd Yes I am planning to do something like below in my workflow pipeline step, but I was expecting to pass some parameters in the upload action instead of doing this hacky stuff myself.
- name: Generate environment wise auto.tfvars
run: |
infra_env=$INPUT_ENVIRONMENT
cp env/${infra_env}.tfvars ${infra_env}.auto.tfvars
env:
INPUT_ENVIRONMENT: ${{ inputs.environment }}
Is there a way to specify a vars file to use? I see it is possible to specify vars individually via env vars but on larger projects, that's not exactly sustainable. I guess the equivalent of
terraform apply -var-file="testing.tfvars"
?