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

Terraform 0.12 Compatibility #109

Closed
kmanning opened this issue Sep 3, 2019 · 2 comments
Closed

Terraform 0.12 Compatibility #109

kmanning opened this issue Sep 3, 2019 · 2 comments
Milestone

Comments

@kmanning
Copy link
Collaborator

kmanning commented Sep 3, 2019

Update and support Terraform 0.12. For information on the breaking changes to plugins see:

https://www.terraform.io/docs/extend/terraform-0.12-compatibility.html

hashicorp/terraform#21454

TF 0.12: terraform validate -check-variables flag not defined

missing required provider arguments should be a WARNING not an ERROR

hashicorp/terraform#21408

@kmanning
Copy link
Collaborator Author

kmanning commented Dec 16, 2019

Work done so far by the PR above:

  1. As of terraform 0.12 and above, terraform validate now needs a terraform init.
  2. The PR above solves this problem by adding terraform init -backend=false to the TerraformValidateStage.
  3. -backend=false is required for TerraformValidateStage, only because many/most of the backend plugins are environment-based, and TerraformValidateStage was never designed to have environment configuration.

Work left to do:

  1. The before/after hooks in TerraformValidateStage are insufficient. You can only decorate around the entirety of delete/checkout/validate. Offer more flexibility here, to allow decorations around terraform validate itself.
  2. Once that's available, remove the hardcoded terraform init introduced by the PR above.
  3. Modify TerraformPlugin to conditionally inject terraform init for 0.12+. For versions prior to 0.12, leave the functionality as-is prior to the first PR for this issue (that is, prior to 0.12, TerraformValidate should NOT run terraform init -backend=false). This will remove the requirement that was initially added as part of this issue - we will NOT require You are using at least terraform 0.9.x (must support '-backend=false')

I'll make a separate PR to complete the left over work for this Issue.

kmanning added a commit that referenced this issue Dec 18, 2019
kmanning added a commit that referenced this issue Jan 14, 2020
@kmanning
Copy link
Collaborator Author

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

No branches or pull requests

1 participant