Skip to content

Commit

Permalink
feat(dnspod): tencentcloud_dnspod_domain_instance support domain_id
Browse files Browse the repository at this point in the history
  • Loading branch information
amincheloh committed Dec 7, 2024
1 parent 1722c24 commit dc220aa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/dnspod_domain_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down

0 comments on commit dc220aa

Please sign in to comment.