Skip to content

Add terraform validation to linting #170

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

Merged
merged 7 commits into from
Feb 23, 2024
Merged

Add terraform validation to linting #170

merged 7 commits into from
Feb 23, 2024

Conversation

matifali
Copy link
Member

This pull request adds terraform validation to the existing linting process. It includes a new script that runs terraform init and validate in each subdirectory containing a main.tf file. This ensures that the terraform code is valid and follows best practices.

Closes #143

@matifali matifali self-assigned this Feb 23, 2024
@matifali matifali requested a review from mafredri February 23, 2024 12:05
@matifali
Copy link
Member Author

For some reason, I cannot get a nonzero exit code even if terraform validate shows errors.

@mafredri
Copy link
Member

For some reason, I cannot get a nonzero exit code even if terraform validate shows errors.

I believe that would be fixed by set -e (or even better, set -euo pipefail).

@matifali matifali requested a review from mafredri February 23, 2024 18:28
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
@matifali matifali merged commit 313ec59 into main Feb 23, 2024
@matifali matifali deleted the validate branch February 23, 2024 18:49
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.

run terraform validate as part of linting/formatting
2 participants