You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My infrastructure is built using terraform files and uses terragrunt for remote backend management. As such, according to issue #251, I must run terrascan on a terraform plan file. Running on any plan file produces the error error cli/run.go:141 scan run failed{error 26 0 invalid terraform json file; error: 'terraform format version shoule be one of '0.1, 0.2''}
This has been mentioned previously in issues #980 and #1483 and does not appear to have a resolution.
As many infrastructures nowadays are shifting over to DRY backend management with services like Terragrunt, I believe this will be a critical issue to fix as this is currently the only way I have found to use terrascan with terragrunt. This outdated format_version error is completely stopping our usage of terrascan.
What I Did
I created the terraform plan file in the required json format and ran the terrascan command: terragrunt show -json tfplan > plan.json terrascan scan --iac-type tfplan --iac-file plan.json
Error
error cli/run.go:141 scan run failed{error 26 0 invalid terraform json file; error: 'terraform format version shoule be one of '0.1, 0.2''}
The text was updated successfully, but these errors were encountered:
Same issue for me as well. sed -i -e 's/"format_version":"1.2"/"format_version":"0.2"/g' plan.json
Can manually swap the versions if you still want to try scanning it, but I don't know what the implications are of the version difference
Same issue for me as well. sed -i -e 's/"format_version":"1.2"/"format_version":"0.2"/g' plan.json Can manually swap the versions if you still want to try scanning it, but I don't know what the implications are of the version difference
This trick worked for me as well. Is there a plan for terrascan to support format_version 1.2?
Description
My infrastructure is built using terraform files and uses terragrunt for remote backend management. As such, according to issue #251, I must run terrascan on a terraform plan file. Running on any plan file produces the error
error cli/run.go:141 scan run failed{error 26 0 invalid terraform json file; error: 'terraform format version shoule be one of '0.1, 0.2''}
This has been mentioned previously in issues #980 and #1483 and does not appear to have a resolution.
As many infrastructures nowadays are shifting over to DRY backend management with services like Terragrunt, I believe this will be a critical issue to fix as this is currently the only way I have found to use terrascan with terragrunt. This outdated format_version error is completely stopping our usage of terrascan.
What I Did
I created the terraform plan file in the required json format and ran the terrascan command:
terragrunt show -json tfplan > plan.json
terrascan scan --iac-type tfplan --iac-file plan.json
Error
error cli/run.go:141 scan run failed{error 26 0 invalid terraform json file; error: 'terraform format version shoule be one of '0.1, 0.2''}
The text was updated successfully, but these errors were encountered: