diff --git a/.changelog/3467.txt b/.changelog/3467.txt new file mode 100644 index 0000000000..7ff6c6ae15 --- /dev/null +++ b/.changelog/3467.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/tencentcloud_private_dns_record: optmize code read function +``` diff --git a/tencentcloud/services/privatedns/resource_tc_private_dns_record.go b/tencentcloud/services/privatedns/resource_tc_private_dns_record.go index 639e27ab22..6a91fe90ff 100644 --- a/tencentcloud/services/privatedns/resource_tc_private_dns_record.go +++ b/tencentcloud/services/privatedns/resource_tc_private_dns_record.go @@ -160,27 +160,14 @@ func resourceTencentCloudDPrivateDnsRecordRead(d *schema.ResourceData, meta inte zoneId := idSplit[0] recordId := idSplit[1] - records, err := service.DescribePrivateDnsRecordByFilter(ctx, zoneId, nil) + record, err := service.DescribePrivateDnsRecordById(ctx, zoneId, recordId) if err != nil { return err } - if len(records) < 1 { - d.SetId("") - log.Printf("[WARN]%s resource `tencentcloud_private_dns_record` [%s] not found, please check if it has been deleted.\n", logId, recordId) - return nil - } - - var record *privatedns.PrivateZoneRecord - for _, item := range records { - if item.RecordId != nil && *item.RecordId == recordId { - record = item - } - } - if record == nil { - d.SetId("") log.Printf("[WARN]%s resource `tencentcloud_private_dns_record` [%s] not found, please check if it has been deleted.\n", logId, recordId) + d.SetId("") return nil } diff --git a/tencentcloud/services/privatedns/service_tencentcloud_private_dns.go b/tencentcloud/services/privatedns/service_tencentcloud_private_dns.go index fc16fc862d..1ce822a05f 100644 --- a/tencentcloud/services/privatedns/service_tencentcloud_private_dns.go +++ b/tencentcloud/services/privatedns/service_tencentcloud_private_dns.go @@ -38,7 +38,7 @@ func (me *PrivateDnsService) DescribePrivateDnsRecordByFilter(ctx context.Contex } }() var ( - limit int64 = 20 + limit int64 = 200 offset int64 = 0 total int64 = -1 ) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy