terraform-provider-rancher2: Failed to install provider in 0.13

hi,

i just upgraded my terraform client from 0.12.28 to 0.13.

i’m using a versions.tf file in a module and copy paste the example from https://registry.terraform.io/providers/rancher/rancher2/latest.

versions.tf terraform { required_providers { rancher2 = { source = "rancher/rancher2" version = "1.10.0" } } }

when i run terraform init i get following output …

Initializing the backend…

Initializing provider plugins…

  • Finding latest version of hashicorp/rancher2…
  • Finding hashicorp/kubernetes versions matching “1.12.0”…
  • Finding hashicorp/helm versions matching “1.2.4”…
  • Finding latest version of -/helm…
  • Finding latest version of -/kubernetes…
  • Finding latest version of -/rancher2…
  • Finding rancher/rancher2 versions matching “1.10.0”…
  • Installing hashicorp/helm v1.2.4…
  • Installed hashicorp/helm v1.2.4 (signed by HashiCorp)
  • Installing -/helm v1.2.4…
  • Installed -/helm v1.2.4 (signed by HashiCorp)
  • Installing -/kubernetes v1.12.0…
  • Installed -/kubernetes v1.12.0 (signed by HashiCorp)
  • Installing -/rancher2 v1.10.0…
  • Installed -/rancher2 v1.10.0 (signed by HashiCorp)
  • Installing rancher/rancher2 v1.10.0…
  • Installed rancher/rancher2 v1.10.0 (signed by a HashiCorp partner, key ID 2EEB0F9AD44A135C)
  • Installing hashicorp/kubernetes v1.12.0…
  • Installed hashicorp/kubernetes v1.12.0 (signed by HashiCorp)

Partner and community providers are signed by their developers. If you’d like to know more about provider signing, you can read about it here: https://www.terraform.io/docs/plugins/signing.html

Warning: Additional provider information from registry

The remote registry returned warnings for registry.terraform.io/-/rancher2:

  • For users on Terraform 0.13 or greater, this provider has moved to rancher/rancher2. Please update your source in required_providers.

Error: Failed to install providers

Could not find required providers, but found possible alternatives:

hashicorp/rancher2 -> terraform-providers/rancher2

If these suggestions look correct, upgrade your configuration with the following command: terraform 0.13upgrade .

am i doing something wrong? thanks for the help

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 17 (4 by maintainers)

Most upvoted comments

@amnk, I originally had the same error return on a plan/apply however, I was providing a “bootstrap” alias for the provider similar to the documentation.

# Configure the Rancher2 provider to bootstrap and admin
# Provider config for bootstrap
provider "rancher2" {
  alias = "bootstrap"

  api_url   = "https://rancher.my-domain.com"
  bootstrap = true
}

# Create a new rancher2_bootstrap using bootstrap provider config
resource "rancher2_bootstrap" "admin" {
  provider = "rancher2.bootstrap"

  password = "blahblah"
  telemetry = true
}

After removing the alias on the provider and the provider on the resource, everything planned/applied properly.

I will attach it to support request gz#11920

We got behind this by doing 0.13upgrade, but it still fails with


 Error: [ERROR] No api_url provided
 
  on <empty> line 0:

   (source code not available)

@amnk This is most likely because your rancher provider config… ie: provider "rancher2" { api_url = "https://rancher.my-domain.com" access_key = var.rancher2_access_key secret_key = var.rancher2_secret_key } is at the root module level, but the required providers block with rancher2 is at the child level. I ran into this when I ran their recommended command to fix it.