ljfranklin/terraform-resource

terraform init

Closed this issue · 3 comments

We switched our terraform machine from using gcp DNS to aws Route 53. Our creation script works, but the destroy pipeline does not.

We're confused by this error message. In looking at the go code, it appears that Destroy does a runInit which in turn does a terraform init.

Thanks for your help

Plugin reinitialization required. Please run "terraform init".
Reason: Could not satisfy plugin requirements.

Plugins are external binaries that Terraform uses to access and manipulate
resources. The configuration provided requires plugins which can't be located,
don't satisfy the version constraints, or are otherwise incompatible.

1 error(s) occurred:

* provider.aws: no suitable version installed
  version requirements: "(any version)"
  versions installed: none

Terraform automatically discovers provider requirements from your
configuration, including providers used in child modules. To see the
requirements and constraints from each module, run "terraform providers".


Error: error satisfying plugin requirements

@professor when you say your create script works, are you doing a put to the Terraform resource to create the environment or is the environment created in a separate task or manual script? And do you have a section like the following somewhere in your .tf files:

provider "google" {
  credentials = "..."
  project     = "my-project-id"
  region      = "us-central1"
}

Yes, we are doing a put to the terraform resource to create a gcp environment with aws dns...

      - put: terraform
        params:
          terraform_source: terraforming-gcp/terraforming-pks
          var_files:
            - terraform_vars/terraform.tfvars
          override_files:
            - pks-releng-ci/tasks/populate-terraform-variables/iaas_overrides/gcp_override.tf
          generate_random_name: true

I'll look at the .tf files soon.

We figured it out. We had code on two branches. When I joined the story, I wasn't aware of this. It's all fixed. User error strikes again!