support passing variable files
See original GitHub issueI have recently started getting Check: CKV_AZURE_43: “Ensure the Storage Account naming rules”
On code that deploys ok.
my code (abbreviated) looks like
resource "azurerm_storage_account" "remote-state" {
name = "${var.org_short}${var.env_short}${var.loc_short}${var.service}stg"
}
We use an external variables file (common.tfvars) and plan and deploy using the tf command
terraform plan -var-file=…\common.tfvars which is located in a different directory
Describe the solution you’d like I would like to be able to tell checkov that it should also evaluate variables from this file eg: _bridgecrew -d . --var-file=…\common.tfvars
This would then allow the checks to validate length and others correctly
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:5
Top Results From Across the Web
C: Passing variables between files - Stack Overflow
I'm trying to pass a local variable (in func1) to a function (func2) in another file, but func2 requires that as a global...
Read more >How to pass extra variables to an Ansible playbook - Red Hat
For more ways to pass variables to Ansible playbooks, such as using JSON and external variable files, check out the Ansible documentation site....
Read more >How can I pass arguments to my do-files? - Stata
You pass arguments to your do-files by adding the arguments to the run or do command line. Stata will save the extra arguments...
Read more >Passing parameters to file - TeamCity Support | JetBrains
Hello, how can i pass parameters to file in TeamCity. I can get it to work if i just type in my "code"...
Read more >Passing Variables from an #Included text File - AutoIt Forums
Im a noobie and I would like to:1. Declare variables in a text file2. #Include that file from outside the include libraryHeres the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@HarleyB123 , the problem with the above especially with tf 0.15 it only works on the new infrastructure code as plan now only shows the lines that change in order to make it more readable.
@bridgecrew-bot this really does need supporting as it stops us from taking checkov & bridgecrew forwards
Additionally, assuming your branch structure matches your environment and their variable names (this was the case for me, where my branch was
env/uat
foruat.tfvars
and themain
branch was myprod.tfvars
), you could run bash in a github action like so to get the branch name:and then rename the variables file