Skip to content

Fix terraform validate test - #11

Merged
Erik Osterman (Cloud Posse) (osterman) merged 3 commits into
cloudposse:masterfrom
masterpointio:fix-terraform-validate-test
May 7, 2020
Merged

Fix terraform validate test#11
Erik Osterman (Cloud Posse) (osterman) merged 3 commits into
cloudposse:masterfrom
masterpointio:fix-terraform-validate-test

Conversation

@Gowiem

Copy link
Copy Markdown
Member

what

  • Adds a "Prerequisites" header to README to mention Bash v5+ and bats-core requirements. These threw me for a while, so I figured adding them here would help others when running locally.
  • Fixes validate.bats failing for independent modules due to the "The argument 'region' is required" error. This is the same underlying issue as Fixes #207, supplying AWS_DEFAULT_REGION fixes v0.12 tf validate聽build-harness#208.
  • Fixes what I believe is just a simple typo: TF_CLI_ARGS_init is set in setup but then isn't unset in teardown. TF_CLI_ARGS_plan is unset instead. I updated teardown to unset TF_CLI_ARGS_init instead as that just makes sense.

why

  • Fixes running validate.bats locally.
  • Informs others of prereqs so they don't run into trying to find these dependencies themselves.

references

This is the same issue as 
cloudposse/build-harness#208. Without a default 
region, `terraform validate` fails when running against independent 
modules as they do not have a provider/region supplied.
I believe this was just a mistake but I may be wrong. setup() sets 
TF_CLI_ARGS_init, but teardown unsets TF_CLI_ARGS_plan. That seemed like 
a small typo to me, so I figured I would include this.
Comment thread README.yaml
@osterman
Erik Osterman (Cloud Posse) (osterman) merged commit 237e8e2 into cloudposse:master May 7, 2020
@Gowiem
Matt Gowie (Gowiem) deleted the fix-terraform-validate-test branch May 7, 2020 20:20
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.

2 participants