aliyun / terraform-provider-alicloud

Terraform AliCloud provider
https://www.terraform.io/docs/providers/alicloud/
Mozilla Public License 2.0
590 stars 553 forks source link

DescribeZoneInfo fails although it works in CLI #1700

Open Ghost---Shadow opened 5 years ago

Ghost---Shadow commented 5 years ago
Terraform v0.12.9
+ provider.alicloud v1.57.0
+ provider.local v1.3.0
+ provider.template v2.1.2

Please apply the same fix as this ticket https://github.com/terraform-providers/terraform-provider-alicloud/issues/1618

But for

Error: [ERROR] terraform-provider-alicloud/alicloud/resource_alicloud_pvtz_zone.go:98:
[ERROR] terraform-provider-alicloud/alicloud/service_alicloud_pvtz.go:44: Resource xxx DescribeZoneInfo Failed!!! [SDK alibaba-cloud-sdk-go ERROR]:
SDK.ServerError
ErrorCode: Zone.Invalid.UserId
Recommend: 
RequestId: xxx
Message: Zone userid is invalid.
xiaozhu36 commented 5 years ago

HI @Ghost---Shadow It seems like the zone does not belong to you. Can you check it by the web console.

Ghost---Shadow commented 5 years ago

The domain belongs to the RAM role I am assuming. Just like ticket #1618 the provider does not assume the role correctly.

xiaozhu36 commented 5 years ago

HI @Ghost---Shadow How did you assume role? Did you set access key when assuming it?

Ghost---Shadow commented 5 years ago

I am using the assume_role of the terraform OSS backend and my RAM role ARN is set in aliyun configure

xiaozhu36 commented 4 years ago

HI @Ghost---Shadow The OSS backend config can no been used by provider. So, after set it in the oss backend, you also need to set the config in the provider.

Ghost---Shadow commented 4 years ago

@xiaozhu36 I was importing these resources from another module. After adding a provider.tf in the imported module, I am no longer getting this error.