From dc220aa2e026c546d49ad1bc9a76a5088bb06dbc Mon Sep 17 00:00:00 2001 From: Amin Cheloh Date: Sat, 7 Dec 2024 09:54:01 +0700 Subject: [PATCH] feat(dnspod): `tencentcloud_dnspod_domain_instance` support domain_id --- .../services/dnspod/resource_tc_dnspod_domain_instance.go | 6 ++++++ .../dnspod/resource_tc_dnspod_domain_instance_test.go | 1 + website/docs/r/dnspod_domain_instance.html.markdown | 1 + 3 files changed, 8 insertions(+) diff --git a/tencentcloud/services/dnspod/resource_tc_dnspod_domain_instance.go b/tencentcloud/services/dnspod/resource_tc_dnspod_domain_instance.go index 1b7134c71c..4b28f95e83 100644 --- a/tencentcloud/services/dnspod/resource_tc_dnspod_domain_instance.go +++ b/tencentcloud/services/dnspod/resource_tc_dnspod_domain_instance.go @@ -55,6 +55,11 @@ func ResourceTencentCloudDnspodDomainInstance() *schema.Resource { Description: "The remark of Domain.", }, //computed + "domain_id": { + Type: schema.TypeInt, + Computed: true, + Description: "ID of the domain.", + }, "create_time": { Type: schema.TypeString, Computed: true, @@ -153,6 +158,7 @@ func resourceTencentCloudDnspodDomainInstanceRead(d *schema.ResourceData, meta i 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) diff --git a/tencentcloud/services/dnspod/resource_tc_dnspod_domain_instance_test.go b/tencentcloud/services/dnspod/resource_tc_dnspod_domain_instance_test.go index 15fcae4f04..c9ab080cba 100644 --- a/tencentcloud/services/dnspod/resource_tc_dnspod_domain_instance_test.go +++ b/tencentcloud/services/dnspod/resource_tc_dnspod_domain_instance_test.go @@ -61,6 +61,7 @@ func TestAccTencentCloudDnspodDoamin(t *testing.T) { Config: testAccTencentCloudDnspodDomain, Check: resource.ComposeTestCheckFunc( testAccCheckDnspodDomainExists("tencentcloud_dnspod_domain_instance.domain"), + resource.TestCheckResourceAttr("tencentcloud_dnspod_domain_instance.domain", "domain_id", "0"), resource.TestCheckResourceAttr("tencentcloud_dnspod_domain_instance.domain", "domain", "terraformer.com"), resource.TestCheckResourceAttr("tencentcloud_dnspod_domain_instance.domain", "is_mark", "no"), resource.TestCheckResourceAttr("tencentcloud_dnspod_domain_instance.domain", "slave_dns", "no"), diff --git a/website/docs/r/dnspod_domain_instance.html.markdown b/website/docs/r/dnspod_domain_instance.html.markdown index 4dca5852d3..8973a25ec3 100644 --- a/website/docs/r/dnspod_domain_instance.html.markdown +++ b/website/docs/r/dnspod_domain_instance.html.markdown @@ -36,6 +36,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - ID of the resource. * `create_time` - Create time of the domain. +* `domain_id` - ID of the domain. * `slave_dns` - Is secondary DNS enabled.