diff --git a/alicloud/resource_alicloud_dcdn_domain.go b/alicloud/resource_alicloud_dcdn_domain.go index f8c04d1e507f..0dc40ff61326 100644 --- a/alicloud/resource_alicloud_dcdn_domain.go +++ b/alicloud/resource_alicloud_dcdn_domain.go @@ -361,7 +361,7 @@ func resourceAliCloudDcdnDomainUpdate(d *schema.ResourceData, meta interface{}) if !d.IsNewResource() && d.HasChange("scope") { update = true - request["Property"] = d.Get("scope") + request["Property"] = fmt.Sprintf(`{"coverage":"%s"}`, d.Get("scope")) } if update { diff --git a/alicloud/resource_alicloud_dcdn_domain_test.go b/alicloud/resource_alicloud_dcdn_domain_test.go index cae0d88a095d..deeb933553b6 100644 --- a/alicloud/resource_alicloud_dcdn_domain_test.go +++ b/alicloud/resource_alicloud_dcdn_domain_test.go @@ -131,6 +131,7 @@ func TestAccAliCloudDcdnDomain_basic0(t *testing.T) { testAccCheck(map[string]string{ "domain_name": name, "sources.#": "1", + "scope": "overseas", }), ), }, @@ -740,6 +741,16 @@ func TestAccAliCloudDcdnDomain_basic7246_change(t *testing.T) { }), ), }, + { + Config: testAccConfig(map[string]interface{}{ + "scope": "global", + }), + Check: resource.ComposeTestCheckFunc( + testAccCheck(map[string]string{ + "scope": "global", + }), + ), + }, { ResourceName: resourceId, ImportState: true,