Skip to content

Commit 228d331

Browse files
authored
fix(dnspod): [128831371] tencentcloud_dnspod_domain_instance fix int error (#3611)
* fix dnspod error * fix group_id * add changelog
1 parent cd947f3 commit 228d331

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

.changelog/3611.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_dnspod_domain_instance: fix error while setting `group_id`
3+
```

tencentcloud/services/dnspod/resource_tc_dnspod_domain_instance.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ func resourceTencentCloudDnspodDomainInstanceCreate(d *schema.ResourceData, meta
9090
if v, ok := d.GetOk("domain"); ok {
9191
domain = v.(string)
9292
}
93-
if v, ok := d.GetOk("group_id"); ok {
94-
groupId = v.(uint64)
93+
if v, ok := d.GetOkExists("group_id"); ok {
94+
groupId = *helper.IntUint64(v.(int))
9595
}
9696
if v, ok := d.GetOk("is_mark"); ok {
9797
isMark = v.(string)
@@ -156,14 +156,28 @@ func resourceTencentCloudDnspodDomainInstanceRead(d *schema.ResourceData, meta i
156156
response = result
157157
info := response.Response.DomainInfo
158158

159-
d.SetId(*response.Response.DomainInfo.Domain)
160-
161159
_ = d.Set("domain_id", info.DomainId)
162160
_ = d.Set("domain", info.Domain)
163161
_ = d.Set("create_time", info.CreatedOn)
164162
_ = d.Set("is_mark", info.IsMark)
165163
_ = d.Set("slave_dns", info.SlaveDNS)
166164

165+
if info.Status != nil {
166+
if *info.Status == "pause" {
167+
_ = d.Set("status", DNSPOD_DOMAIN_STATUS_DISABLE)
168+
} else {
169+
_ = d.Set("status", info.Status)
170+
}
171+
}
172+
173+
if info.Remark != nil {
174+
_ = d.Set("remark", info.Remark)
175+
}
176+
177+
if info.GroupId != nil {
178+
_ = d.Set("group_id", info.GroupId)
179+
}
180+
167181
return nil
168182
})
169183
if err != nil {

tencentcloud/services/dnspod/service_tencentcloud_dnspod.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ type DnspodService struct {
2525
client *connectivity.TencentCloudClient
2626
}
2727

28-
// ////////api
2928
func (me *DnspodService) ModifyDnsPodDomainStatus(ctx context.Context, domain string, status string) (errRet error) {
3029
logId := tccommon.GetLogId(ctx)
3130
request := dnspod.NewModifyDomainStatusRequest()

0 commit comments

Comments
 (0)