From 2072d1486c2c1ded8259a628dc2e447a519a2a92 Mon Sep 17 00:00:00 2001 From: Vaerh Date: Fri, 10 Mar 2023 19:52:04 +0300 Subject: [PATCH] fix: /ip/dns/record - field type is missing Fixes #150 --- routeros/resource_ip_dns_record.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/routeros/resource_ip_dns_record.go b/routeros/resource_ip_dns_record.go index 4b94f56d..17cb645e 100644 --- a/routeros/resource_ip_dns_record.go +++ b/routeros/resource_ip_dns_record.go @@ -2,6 +2,7 @@ package routeros import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) /* @@ -14,6 +15,14 @@ import ( "name": "router.lan", "ttl": "1d" }, + { + ".id": "*2", + "address": "2001:db8:1000::1", + "disabled": "false", + "dynamic": "false", + "name": "ipv6.example.com", + "ttl": "1d", + "type": "AAAA"} { ".id": "*9", "address": "192.168.88.1", @@ -57,6 +66,14 @@ func ResourceDnsRecord() *schema.Resource { Computed: true, Description: "The ttl of the DNS record.", }, + "type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Type of the DNS record. Available values are: A, AAAA, CNAME, FWD, MX, NS, NXDOMAIN, SRV, TXT", + ValidateFunc: validation.StringInSlice([]string{"A", "AAAA", "CNAME", "FWD", "MX", "NS", "NXDOMAIN", + "SRV", "TXT "}, false), + }, } return &schema.Resource{ Description: "Creates a DNS record on the MikroTik device.",