sbercloud-terraform / terraform-provider-sbercloud

Terraform SberCloud Provider
https://registry.terraform.io/providers/sbercloud-terraform/sbercloud/latest/docs
Mozilla Public License 2.0
34 stars 21 forks source link

sbercloud terraform provider update issue #329

Closed madbutcher82 closed 2 days ago

madbutcher82 commented 2 weeks ago

Dear colleagues,

We encountered an issue while trying to update the sbercloud provider for terraform.

While changing the version from 1.11.6 to 1.12.4:

terraform {
  required_providers {
    sbercloud = {
      source  = "sbercloud-terraform/sbercloud"
      #version = "1.11.6"
      version = "1.12.4"
    }
  }
}

we get the following error output:

Initializing provider plugins...
- Finding sbercloud-terraform/sbercloud versions matching "1.11.6, 1.12.4"...
- Finding latest version of hashicorp/local...
╷
│ Error: Failed to query available provider packages
│ 
│ Could not retrieve the list of available versions for provider sbercloud-terraform/sbercloud: no available releases match the given constraints 1.11.6, 1.12.4
╵
╷
│ Error: Incompatible provider version
│ 
│ Provider registry.terraform.io/hashicorp/local v2.5.2 does not have a package available for your current platform, linux_amd64.
│ 
│ Provider releases are separate from Terraform CLI releases, so not all providers are available for all platforms. Other versions of this provider may have different platforms supported.

The settings in .terraformrc are configured according to the setup instructions (https://cloud.ru/docs/terraform/ug/topics/guides__mirrors.html):

provider_installation {
   network_mirror {
      url = "https://terraform.cloud.ru/"
      include = ["registry.terraform.io/*/*"]
   }
   direct {
      exclude = ["registry.terraform.io/*/*"]
   }
}

Terraform version:

15:32 # terraform version 
Terraform v1.9.8
on linux_amd64
+ provider registry.terraform.io/hashicorp/local v2.5.1
+ provider registry.terraform.io/sbercloud-terraform/sbercloud v1.11.6
0ohmresistor commented 2 days ago

Good afternoon! Now there are some problems with our mirror, try to install new version of provider locally:

  1. Download compiled binary (or compile it from source code)
  2. Drop it into folder /Users/user/go/bin/
  3. Change .terraformrc file like this
    provider_installation {
    dev_overrides {
    "mycloud.com/myorg/sbercloud" = "/Users/user/go/bin/"
    }
    direct {}
    }
  4. In main.tf file change init like shown below
    terraform {
    required_providers {
    sbercloud = {
      source  = "mycloud.com/myorg/sbercloud"
    }
    }
    }
    provider "sbercloud" {
    auth_url = "https://iam.ru-moscow-1.hc.sbercloud.ru/v3" 
    region   = "ru-moscow-1" 
    access_key = var.access_key
    secret_key = var.secret_key
    }

    After these steps you can use local provider version.

Also, check this issue https://github.com/sbercloud-terraform/terraform-provider-sbercloud/issues/321