Skip to content
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

Fix Terraform Validate failing because AWS_DEFAULT_REGION isn't set #152

Closed
wants to merge 1 commit into from

Conversation

Makeshift
Copy link

terraform validate will fail to run if AWS_DEFAULT_REGION isn't set, as of 0.13.

Setting it to us-east-1 shouldn't matter, as Terraform does no provider checks anyway.

@ahmad-hamade
Copy link

@Makeshift I solved this issue by passing the region name as an args to the hook:

  - repo: git://github.com/antonbabenko/pre-commit-terraform
    rev: v1.43.0
    hooks:
      - id: terraform_validate
        args: ['--envs=AWS_DEFAULT_REGION="eu-west-1"']

You would still need to run terraform init before running the hook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants