Skip to content

Commit

Permalink
resource/alicloud_dcdn_domain: Fixes the updating arguement scope doe…
Browse files Browse the repository at this point in the history
…s not working error
  • Loading branch information
xiaozhu36 committed Jan 4, 2025
1 parent dd9d3fb commit 8c3406b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion alicloud/resource_alicloud_dcdn_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
11 changes: 11 additions & 0 deletions alicloud/resource_alicloud_dcdn_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func TestAccAliCloudDcdnDomain_basic0(t *testing.T) {
testAccCheck(map[string]string{
"domain_name": name,
"sources.#": "1",
"scope": "overseas",
}),
),
},
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8c3406b

Please sign in to comment.