<#18489 `pants check` fails on Terraform modules d...
# github-notifications
c
#18489 `pants check` fails on Terraform modules due to lack of `terraform init` Issue created by ndellosa95 Describe the bug After setting up some basic Terraform in my repo, running
pants check ::
fails with the following error message:
Copy code
16:48:40.39 [ERROR] Completed: pants.backend.terraform.goals.check.terraform_check - terraform-validate failed (exit code 1).
Partition #1 - `terraform validate` on `myrepo/terraform/environments/dev`:
╷
│ Error: Module not installed
│ 
│   on myrepo/terraform/environments/dev/main.tf line 23:
│   23: module "my_module" {
│ 
│ This module is not yet installed. Run "terraform init" to install all
│ modules required by this configuration.
╵

Partition #2 - `terraform validate` on `myrepo/terraform/modules/infrastructure`:
╷
│ Error: Missing required provider
│ 
│ This configuration requires provider
│ <http://registry.terraform.io/hashicorp/azurerm|registry.terraform.io/hashicorp/azurerm>, but that provider isn't available.
│ You may be able to install it automatically by running:
│   terraform init
╵



✕ terraform-validate failed.
Pants version 2.15 OS Intel Mac Additional info Ideally,
pants check
would run
init
,
validate
, and
plan
. I'm going to open a feature request for this exact thing. It would also be super useful if you could run
terraform apply
through Pants, either using the
publish
or
experimental-deploy
goals (another issue, the difference between these two should be elaborated on as they're both from the core backend). pantsbuild/pants