nhurel / terraspec

Terraform unit test framework
Mozilla Public License 2.0
79 stars 7 forks source link

Use and support Terraform 1.x #23

Open yitsushi opened 3 years ago

yitsushi commented 3 years ago

Right the master uses github.com/hashicorp/terraform v0.14.9. As Terraform 1.0 was announced. Everything should work from v0.15, but Terraspec uses v0.14 which can be an issue (should not).

Starting with Terraform 0.15 and continuing through the lifecycle of 1.x, you can now upgrade to a new Terraform version and your workflows will continue to be operational, just as they were in those prior versions. There is no requirement for upgrade tools, refactoring, or other changes in order to use Terraform 1.x.

At the same time "Terraform Plugin SDK v1 End of Life".

A separate branch for that would be good/enough to start experimenting with it.

We will start updating our tooling in a few weeks, so we will try to update it and come back if something blows up. If everything is working, we will come back with a PR if it's not resolved yet.

nhurel commented 3 years ago

Hello

I started to check if I could upgrade terraform dependency to 1.x but quickly found that : https://github.com/hashicorp/terraform/pull/28723 Basically all terraform code terraspec was relying on has been moved to internal package, making it impossible to use anymore.

With a huuuge refactoring, I may be able to keep mocking all plugin calls thanks to the TF_REATTACH_PROVIDER environment variable (https://github.com/hashicorp/terraform/blob/main/main.go#L252). This environment variable exists in official documentation so I can hope this will be supported in the long term :crossed_fingers:

It's a very important piece of work to move to that approach. I hope I'll find time to manage it

yitsushi commented 3 years ago

It's sad, thanks for checking it.

wyardley commented 2 years ago

Hi @nhurel I know we had been working on trying to get it working with newer tf versions and IIRC you'd had a branch working on it. Is there any chance of getting a new release with support for 1.x?

nhurel commented 2 years ago

Hello @wyardley , Unfortunately, with terraform code moved to an internal package in their source code, I can't add support for terraform 1.x.

wyardley commented 2 years ago

Ok, thanks for responding.