Skip to content

alicloud_cr_ee_instance incorrectly sets ResourceType for CN regions on International accounts #9159

@ttd-kellykane

Description

@ttd-kellykane

Attempting to create a Container Registry in the Beijing region results in a ProductType mismatch error. Our accounts have resources both in China and Internationally. This should either be exposed as a configuration option or the detection logic fixed based on the region it's being applied into. Looking in the issue decoder returned by the provider I get: "ProductType":"acr_ee_public_intl"

This appears to be hardcoded here:
https://github.com/aliyun/terraform-provider-alicloud/blob/master/alicloud/resource_alicloud_cr_ee_instance.go#L220

resource "alicloud_cr_ee_instance" "my-new-repo-basic" {
    payment_type = "Subscription"
    period = 1
    renew_period = 1
    renewal_status = "AutoRenewal"
    instance_type = "Standard"
    instance_name = "my-new-repo-basic"
}
alicloud_cr_ee_instance.my-new-repo-basic:  Creating...
╷
│ Error: [ERROR] terraform-provider-alicloud/alicloud/resource_alicloud_cr_ee_instance.go:244: Resource alicloud_cr_ee_instance CreateInstance Failed!!! [SDK alibaba-cloud-sdk-go ERROR]:
│ SDKError:
│    StatusCode: 200
│    Code: COMMODITY.INVALID_COMPONENT
│    Message: 模块非法
│    Data: {"Code":"COMMODITY.INVALID_COMPONENT","HostId":"business.ap-southeast-1.aliyuncs.com","Message":"模块非法","Recommend":"https://api.alibabacloud.com/troubleshoot?intl_lang=EN_US&q=COMMODITY.INVALID_COMPONENT&product=BssOpenApi&requestId=[redacted]","RequestId":"[redacted]"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions