huaweicloud / terraform-provider-hcs

Huawei Cloud Stack Terraform provider
https://registry.terraform.io/providers/huaweicloud/hcs/latest/docs
Mozilla Public License 2.0
18 stars 6 forks source link

【terraform init error】provider binary not found #4

Open moailaozi1 opened 6 months ago

moailaozi1 commented 6 months ago

Terraform Version

Terraform v1.8.3
on linux_amd64

Terraform Configuration Files

terraform {
  required_version = ">= 0.13"

  required_providers {
    huaweicloud = {
      source = "local-registry/huaweicloud/huaweicloud"
      version = ">= 2.3.4"
    }
  }
}

Debug Output

Crash Output

Expected Behavior

Initializing the backend... Initializing provider plugins... Terraform has been successfully initialized! You may now begin working with Terraform. Try running "terraform plan" to see any changes that are required for your infrastructure. All Terraform commands should now work. If you ever set or change modules or backend configuration for Terraform, rerun this command to reinitialize your working directory. If you forget, other commands will detect it and remind you to do so if necessary.

Actual Behavior

Initializing the backend...

Initializing provider plugins...

Steps to Reproduce

unzip -d ~/.terraform.d/plugins/local-registry/huaweicloud/huaweicloud/2.3.4/linux_amd64/ /root/terraform-provider-hcs_2.3.4_linux_amd64.zip Archive: /root/terraform-provider-hcs_2.3.4_linux_amd64.zip inflating: /root/.terraform.d/plugins/local-registry/huaweicloud/huaweicloud/2.3.4/linux_amd64/CHANGELOG.md
inflating: /root/.terraform.d/plugins/local-registry/huaweicloud/huaweicloud/2.3.4/linux_amd64/LICENSE
inflating: /root/.terraform.d/plugins/local-registry/huaweicloud/huaweicloud/2.3.4/linux_amd64/README.md
inflating: /root/.terraform.d/plugins/local-registry/huaweicloud/huaweicloud/2.3.4/linux_amd64/terraform-provider-hcs_v2.3.4

  1. terraform init

Additional Context

References

moailaozi1 commented 6 months ago

Add a comment

fix . Need terraform-provider-huaweicloud, but unzip is terraform-provider-hcs_v2.3.4

so i

cp terraform-provider-hcs_v2.3.4 terraform-provider-huaweicloud

and it works

chengxiangdong commented 4 months ago
terraform {
  required_version = ">= 0.13"

  required_providers {
    huaweicloud = {
      source = "local-registry/huaweicloud/huaweicloud"
      version = ">= 2.3.4"
    }
  }
}

local-registry/huaweicloud/huaweicloud is the provider of Huawei Cloud, not the Huawei Cloud Stack. For Huawei Cloud Stack, the source should be local-registry/huaweicloud/hsc .

When src is prefixed with local-registry, you need to copy terraform-provider-huaweicloud to ~/.terraform.d/plugins/local-registry/huaweicloud/hsc/2.3.4/linux_amd64.