Skip to content

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

Closed
Makeshift wants to merge 1 commit intoantonbabenko:masterfrom
Makeshift:master
Closed

Fix Terraform Validate failing because AWS_DEFAULT_REGION isn't set#152
Makeshift wants to merge 1 commit intoantonbabenko:masterfrom
Makeshift:master

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