Comments (14)
It seems that it is required to run terraform init
for all sub directory modules. How can we workaround this or pre-execute terraform init
automatically?
from pre-commit-terraform.
I would suggest updating the command terraform init
here and pass -upgrade=true
so it will redownload the plugins again if they are corrupted
init_output=$(terraform init -backend=false -upgrade=true 2>&1)
from pre-commit-terraform.
Hi @zacharyabresch !
v1.25.0 of pre-commit-terraform
has been just released after #77 was merged. This should make terraform_tflint
usable for you. Check comments for passing arguments in #76 for some examples.
from pre-commit-terraform.
I am using v1.25.0
and, outwardly, it looks the issue still exists for that. I think the CWD of the terraform validate
command has to be the subdirectory and I'm guessing that ins't how it is exec'd within the shell script that implements the hook.
from pre-commit-terraform.
I finally got a chance to hook this up and tflint
worked flawlessly this time. Thanks for the update and effort!
from pre-commit-terraform.
@zacharyabresch can we close this issue ?
from pre-commit-terraform.
terraform_validate
hook has been just updated in #100, and v1.29.0 is now released. Please give it a try!
from pre-commit-terraform.
I don't think this is fixed. I just installed v1.29.0 and I'm seeing lots of:
Error: Module not installed
for terraform validate
from pre-commit-terraform.
@ghostsquad Same behaviour in my case
from pre-commit-terraform.
Ping! Still facing this issue for both terraform_validate
and terraform_tflint
. Any known workarounds for running terraform init
for all sub-directories?
from pre-commit-terraform.
I just realized terraform_validate
only did not work the first time (when all subfolders had no .terraform
folders). It worked after the first time.
from pre-commit-terraform.
I have released an updated version (v1.44.0 ) where terraform_validate
runs if no .terraform
folder found.
See #158 and updated README.md
file.
terraform-aws-modules/terraform-aws-lambda#68 - here you can see how I use both terraform_validate
and terraform_tflint
.
from pre-commit-terraform.
To be fair, I was already using v1.44.0
version and still ran into the first time problem.
from pre-commit-terraform.
It may be that .terraform
folder was not correct. See note in point 3 here.
from pre-commit-terraform.
Related Issues (20)
- mapfile: command not found in zsh HOT 4
- Add `terragrunt_providers_lock` hook HOT 11
- terraform_checkov hook fails in Docker container since version v1.83.5 HOT 5
- Checkov install silently fails during image build (and is also missing when pulling from ghcr.io) HOT 4
- Bash environment variable expansion not working for trivy HOT 26
- Provide non-root docker build HOT 4
- terraform validate: Force rerun `t init` when plugin cache is enabled and parrallelism conflit happens HOT 8
- Ability to use terraform_plan framework of checkov HOT 8
- [trivy/pre-commit] Terraform trivy configuration excludes .trivyignore files, forcing repetitive ignore statements HOT 7
- Windows Support / Rewrite hooks to Python HOT 11
- Quotation Marks in Environment Variables HOT 2
- Get docker image running in github action HOT 10
- [tf aws provider version] terraform_validate false negative on `aws_kinesis_firehose_delivery_stream.extended_s3_configuration.file_extension` HOT 3
- Add PATH to terraform_docs HOT 7
- [terraform outdated provider] New Data Source: aws_ecr_lifecycle_policy_document HOT 4
- Remove Political Banners from Repo
- [`trivy:ignore:` usage] Terraform Security Check AVD-AWS-0342 HOT 9
- Terragrunt validate-inputs hook? HOT 7
- Validate failing to upgrade lock file locally on version change HOT 3
- Intermittently "no such file or directory" error seen when using trivy pre-commit hook HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pre-commit-terraform.