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

Add terraform_required_providers rule #731

Merged
merged 4 commits into from
May 5, 2020

Conversation

bendrucker
Copy link
Member

@bendrucker bendrucker commented May 1, 2020

This PR adds a rule that checks for terraform.required_providers and falls back to provider.version if set. It borrows copy from the Terraform docs:

https://www.terraform.io/docs/configuration/providers.html#provider-versions

@mveitas
Copy link
Contributor

mveitas commented May 1, 2020

👍 I recently added a rule to enforce that the terraform required_version attribute be set for a module and thought about making it a rule to perform enforcement of the version and the providers within the terraform block. Separating this out keep the code simple and easy to understand!

@mveitas
Copy link
Contributor

mveitas commented May 1, 2020

You are going to need to add the rule here: https://github.com/mveitas/tflint/blob/master/rules/provider.go

@bendrucker
Copy link
Member Author

Thanks, will do!

Co-authored-by: Kazuma Watanabe <watassbass@gmail.com>
@bendrucker bendrucker requested a review from wata727 May 4, 2020 17:51
@bendrucker
Copy link
Member Author

Fixed the two mistakes in the docs, thanks!

Copy link
Member

@wata727 wata727 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@wata727 wata727 merged commit 6894267 into terraform-linters:master May 5, 2020
@bendrucker bendrucker deleted the provider-versions branch May 5, 2020 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants