huaweicloud / terraform-provider-huaweicloud

Terraform HuaweiCloud provider
https://www.terraform.io/docs/providers/huaweicloud/
Mozilla Public License 2.0
210 stars 158 forks source link

Terraform in Dublin Region #2957

Closed marciobarbato closed 1 year ago

marciobarbato commented 1 year ago

Terraform Version

Terraform v1.4.5
on linux_amd64

Terraform Configuration Files

provider "huaweicloud" {
  alias       = "cfproj01-dublin"
  region      = "eu-west-101"
  access_key  = "##HUAWEIACCESSKEYAPROJ##"
  secret_key  = "##HUAWEIACCESSSECRETAPROJ##"
  domain_name = "##HUAWEIACCOUNT##"
}

resource "huaweicloud_identity_group" "group_admins" {
  provider = huaweicloud.cfproj01-dublin
  name     = "Cloud Huawei PoC Admins"
}

Debug Output

Planning failed. Terraform encountered an error while generating this plan.

╷ │ Error: Get "https://iam.eu-west-101.myhuaweicloud.eu:443/v3/projects?name=eu-west-101": connection error, retries exhausted. Aborting. Last error was: tls: failed to verify certificate: x509: certificate signed by unknown authority │ │ with provider["registry.terraform.io/huaweicloud/huaweicloud"].cfproj01-dublin, │ on provider.tf line 30, in provider "huaweicloud": │ 30: provider "huaweicloud" { │ ╵

[error]Error: Terraform Plan failed with exit code: 1

Crash Output

Expected Behavior

Terraform Plan should run normally

Actual Behavior

Certificate error while trying to run terraform plan that connects to EU-Dublin region

Steps to Reproduce

terraform init terraform plan

Additional Context

I'm trying to use terraform to create groups in Dublin region, I created a native cloud user for terraform in EU-Dublin region, generated the access key/secret and trying to connect with that. My account can connect to Dublin region via portal

References

ShiChangkuo commented 1 year ago

@marciobarbato can you try to trust the SSL certificate with insecure = true ?

provider "huaweicloud" {
  alias       = "cfproj01-dublin"
  region      = "eu-west-101"
  access_key  = "##HUAWEIACCESSKEYAPROJ##"
  secret_key  = "##HUAWEIACCESSSECRETAPROJ##"
  domain_name = "##HUAWEIACCOUNT##"
  insecure    = true
}
marciobarbato commented 1 year ago

Hi @ShiChangkuo, that did the trick, can you map this for fixing for the next releases ? I don't think that skip SSL validation is a good idea

ShiChangkuo commented 1 year ago

@marciobarbato I'm afraid that this issue is caused by the cloud service side, you can open a service ticket to HuaweiCloud.

ShiChangkuo commented 1 year ago

I will close it temporarily, If you have any questions, please reopen it. Thanks.