Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/3611.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_dnspod_domain_instance: fix error while setting `group_id`
```
22 changes: 18 additions & 4 deletions tencentcloud/services/dnspod/resource_tc_dnspod_domain_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ func resourceTencentCloudDnspodDomainInstanceCreate(d *schema.ResourceData, meta
if v, ok := d.GetOk("domain"); ok {
domain = v.(string)
}
if v, ok := d.GetOk("group_id"); ok {
groupId = v.(uint64)
if v, ok := d.GetOkExists("group_id"); ok {
groupId = *helper.IntUint64(v.(int))
}
if v, ok := d.GetOk("is_mark"); ok {
isMark = v.(string)
Expand Down Expand Up @@ -156,14 +156,28 @@ func resourceTencentCloudDnspodDomainInstanceRead(d *schema.ResourceData, meta i
response = result
info := response.Response.DomainInfo

d.SetId(*response.Response.DomainInfo.Domain)

_ = d.Set("domain_id", info.DomainId)
_ = d.Set("domain", info.Domain)
_ = d.Set("create_time", info.CreatedOn)
_ = d.Set("is_mark", info.IsMark)
_ = d.Set("slave_dns", info.SlaveDNS)

if info.Status != nil {
if *info.Status == "pause" {
_ = d.Set("status", DNSPOD_DOMAIN_STATUS_DISABLE)
} else {
_ = d.Set("status", info.Status)
}
}

if info.Remark != nil {
_ = d.Set("remark", info.Remark)
}

if info.GroupId != nil {
_ = d.Set("group_id", info.GroupId)
}

return nil
})
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type DnspodService struct {
client *connectivity.TencentCloudClient
}

// ////////api
func (me *DnspodService) ModifyDnsPodDomainStatus(ctx context.Context, domain string, status string) (errRet error) {
logId := tccommon.GetLogId(ctx)
request := dnspod.NewModifyDomainStatusRequest()
Expand Down
Loading