windowsterraformchocolateyterraform-provider-gcp

Why does terraformer not find plugin?


I am new to the world of terraform. I am trying to use terraformer on a GCP project, but keep getting plugin not found:

terraformer import google --resources=gcs,forwardingRules,httpHealthChecks --connect=true --
regions=europe-west1,europe-west4 --projects=myproj
2021/02/12 08:17:03 google importing project myproj region europe-west1
2021/02/12 08:17:04 google importing... gcs
2021/02/12 08:17:05 open \.terraform.d/plugins/windows_amd64: The system cannot find the path specified.

Prior to the above, installed terraformer thus: choco install terraformer I downloaded the Google provider, terraform-provider-google_v3.56.0_x5.exe, placed it in my terraform dir, and did terraform init. I checked %AppData\Roaming\terraform.d\plugins\windows_amd64 and the plugins\windows_amd64 did not exist, so I created it, dropped in the Google exe and redid the init.

My main.tf was:

provider "google" {
 project = "{myproj"
  region  = "europe-west2"
  zone    = "europe-west2-a"
}

Could it be the chocolatey install causing this issue? I have never used it before but the alternative install looks daunting!


Solution

  • The daunting instructions worked!

    Run git clone <terraformer repo>
    Run go mod download
    Run go build -v for all providers OR build with one provider go run build/main.go {google,aws,azure,kubernetes and etc}
    Run terraform init against an versions.tf file to install the plugins required for your platform. For example, if you need plugins for the google provider, versions.tf should contain:
    terraform {
      required_providers {
        google = {
          source = "hashicorp/google"
        }
      }
      required_version = ">= 0.13"
    }
    

    making sure to run that version and not the chocolatey one.

    go mod download the flag -x will give output while that command runs, otherwise you might think nothing is happening.