-
-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need the ability to pass an env specific var-file via --args=
#578
Comments
@major0 With "the equivalent" you mean an option for shell command substitution? (quote from What I can suggest for you is to use Env vars to achieve your goal. Let me know if that make sense and we can close this issue as not planned. |
Except specified above, you can use this |
Yay, thanks for expanding my comment with this off-the-shelf option! I keep forgetting you implemented it already 👍🏻 |
Hmm. I am not entirely certain any of these will work for our use case. This is more closely related to hashicorp/terraform#15966 A large swath of Terraform users leverage a common code base for all environments but pass in per-environment settings based on specific workspaces. For example:
From here, it is not exactly easy to run these particular pre-commit hooks while leveraging environment specific var-files. For most of us at the CLI, and w/in CI/CD workflows, the common approach is to use: |
Not sure I'm keen to read through almost a hundred of comments in the linked issue, hence do I get it right: you're asking us to implement what is not yet implemented even in the original tools — right? And what effectively is a bit of shell coding around exporting
What makes you think we're of another kind? 😉 |
What I mean in the essence is that what you're asking for is what has to be done at the tools' end, rather than to be workarounded via 3rd-party automation tool like |
Did you try - id: terraform_tflint
args:
- --args=-var-file="${TF_WORKSPACE}.tfvars" plus
|
Also, when you use workspaces you MUST test every workspace when the code change is done, because TF code changes will affect every workspace, which can have different account/region limitations and so on. This, basically means that when you run CI, you forcibly provide env where you run it, which means there somewhere exists, at least, implicitly specified And none of the pre-commit-terraform hooks run |
What problem are you facing?
Need the equivalent of the following
--var-file
functionality forterraform_tflint
andterraform_tfsec
in the--args
param.The text was updated successfully, but these errors were encountered: