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

Support for Terraform 0.13 #770

Closed
mveitas opened this issue May 22, 2020 · 10 comments
Closed

Support for Terraform 0.13 #770

mveitas opened this issue May 22, 2020 · 10 comments
Milestone

Comments

@mveitas
Copy link
Contributor

mveitas commented May 22, 2020

Beta releases of Terraform 0.13 are going to start shipping on June 3: hashicorp/terraform#25016

@wata727
Copy link
Member

wata727 commented May 22, 2020

In my understanding, the changes don't have a big impact on TFLint, but it seems good to start investigating early when the beta is released.

@bendrucker
Copy link
Member

It's possible that module instances could have some impact, but otherwise agreed that the work should be minimal. Since Terraform versions are for the CLI and don't apply to the go packages, there's always some possibility of breakage. Bits of 0.13 have been landing in master for a few months now so we don't have to wait for actual beta releases to try it out either.

@danieldreier
Copy link

Beta 1 was just released today!

@bendrucker
Copy link
Member

👋 Hey Daniel, eager to try it out! Will open a draft PR upgrading TFLint soon.

@gmazelier
Copy link

I have the following issue when using the new for_each feature for modules:

Failed to load configurations. 1 error(s) occurred:

Error: Reserved argument name in module block

  on main.tf line 60, in module "service":
  60:   for_each                 = toset(var.services)

The name "for_each" is reserved for use in a future version of Terraform.

Also this warning after running upgrade to 0.13 and generating versions.tf:

Warning: Provider source not supported in Terraform v0.12

  on versions.tf line 3, in terraform:
   3:     aws = {
   4:       source = "hashicorp/aws"
   5:     }

A source was declared for provider aws. Terraform v0.12 does not support the provider source attribute. It will be ignored.

@bendrucker
Copy link
Member

Yeah that’s expected. TFLint consumes Terraform as a library. The dependency will need to be updated to support new features.

That’s not to say everything will necessarily work straight away, but simple schema errors like you posted should be immediately addressable.

I’ll spend some time later today getting a branch and draft PR open to track this, including build instructions.

@gmazelier
Copy link

Great!

@bendrucker
Copy link
Member

Opened #804 which will track the effort to update for 0.13. Still some additional work required to handle the fact that modules can have multiple instances. Some more guidance on the 0.13 process, copied from the PR:


For specific issues (crashes, errors, etc.), please open a new issue and reference that you are testing with 0.13. Please include example configuration.

For general discussion, please comment on the main issue.


This will apply once #804 is passing tests. For now please sit tight, but PRs are welcome!

@bendrucker
Copy link
Member

#804 now build/passes tests, please check that out and build locally if you're trying out Terraform 0.13. Now would be a good time to start reporting any unexpected errors for valid configurations (as new issues). As described in #804, TFLint is still not aware of multiple module instances. It won't try to evaluate the for_each or count attributes in module calls which means any attribute using each.* or count.* is unknown. Resources treat these values similarly and don't statically analyze for_each/count except to detect when a resource is skipped altogether.

@wata727 wata727 added this to the v0.19.0 milestone Aug 14, 2020
@wata727
Copy link
Member

wata727 commented Aug 17, 2020

#804 was merged. It will be included in v0.19.

@wata727 wata727 closed this as completed Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants