-
Notifications
You must be signed in to change notification settings - Fork 190
INTMDB-249: [Terraform] Lint and fix linting for examples #1221
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this working? one of the reasons it was commented was because of the number of errors found
This is the action 9408128097: looking at the log it seems working. I will add a fmt error to one of terraform file and see if it fails |
This reverts commit c9e0de7.
--enable-rule=terraform_required_version | ||
popd | ||
done | ||
- name: tf-validate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have divided the original job into two separate jobs, each with a specific purpose:
- tf-validate:
- This job executes three Terraform commands:
terraform init
,terraform fmt
, andterraform validate
- It is necessary to replace the provider with
mongodbatlas-dev
in this job. This is because new resources are not available until the next release. - It is important to note that when using
mongodbatlas-dev
as the provider, theversion
attribute cannot be specified for the dev provider. However,tflint
mandates that theversion
must be set for all providers in the Terraform configuration. This discrepancy is the reason for dividing the initial job.
- This job executes three Terraform commands:
- tflint: this job runs
tflint
@@ -72,7 +72,7 @@ lint: | |||
tools: ## Install dev tools | |||
@echo "==> Installing dependencies..." | |||
go install github.com/client9/misspell/cmd/misspell@latest | |||
go install github.com/terraform-linters/tflint@v0.31.0 | |||
go install github.com/terraform-linters/tflint@v0.46.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated tflint
to latest version
Looks like only versions.tf and variables.tf files had updates. Surprised there were no linting issues with any of the main.tf files in examples, is this just a coincidence? |
@Zuhairahmed We were already running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the fixes
Description
Ticket: INTMDB-249
This PR updates the example action to use the
tflint.sh
script and fixed linting errorsType of change:
Required Checklist:
Further comments