Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong domain when using shared_config_file #3639

Open
yaoluoye opened this issue Nov 9, 2023 · 2 comments
Open

wrong domain when using shared_config_file #3639

yaoluoye opened this issue Nov 9, 2023 · 2 comments

Comments

@yaoluoye
Copy link

yaoluoye commented Nov 9, 2023

Terraform Version

Terraform v1.5.7
on darwin_arm64

Terraform Configuration Files

terraform {
  required_version = ">= 1.5.7"

  required_providers {
    huaweicloud = {
      source  = "huaweicloud/huaweicloud"
      version = ">= 1.36.0"
    }
  }
}

provider "huaweicloud" {
  shared_config_file = "/Users/myname/.hcloud/config.json"
}

data "huaweicloud_vpc" "vpc" {
  name = "vpc-dev"
}

output "data_test" {
  value = data.huaweicloud_vpc.vpc
}

Actual Behavior

Error: error creating VPC client: List projects failed, err=Get "https://iam..myhuaweicloud.com/v3/projects?name=ap-southeast-1": dial tcp: lookup iam..myhuaweicloud.com: no such host

Steps to Reproduce

  1. got the Access Key Id and Secret Access Key
  2. execute command hcloud configure init to create ~/.hcloud/config.json
  3. ceate terraform tf
  4. use shared_config_file get error above
  5. work fine when I replaced shared_config_file with region, access_key, secret_key
@ShiChangkuo
Copy link
Collaborator

@yaoluoye can you check that whether region is exist in config.json?

@starboard-devops
Copy link

Yep, the config.json created by hcloud configure init

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants