Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fqdn attribute for DNS record resources #5000

Merged
merged 5 commits into from
Nov 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions azurerm/resource_arm_dns_a_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ func resourceArmDnsARecord() *schema.Resource {
Required: true,
},

"fqdn": {
Type: schema.TypeString,
Computed: true,
},

"tags": tags.Schema(),
},
}
Expand Down Expand Up @@ -144,6 +149,7 @@ func resourceArmDnsARecordRead(d *schema.ResourceData, meta interface{}) error {
d.Set("resource_group_name", resGroup)
d.Set("zone_name", zoneName)
d.Set("ttl", resp.TTL)
d.Set("fqdn", resp.Fqdn)

if err := d.Set("records", flattenAzureRmDnsARecords(resp.ARecords)); err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions azurerm/resource_arm_dns_a_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func TestAccAzureRMDnsARecord_basic(t *testing.T) {
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMDnsARecordExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "fqdn"),
),
},
{
Expand Down
6 changes: 6 additions & 0 deletions azurerm/resource_arm_dns_aaaa_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ func resourceArmDnsAAAARecord() *schema.Resource {
Required: true,
},

"fqdn": {
Type: schema.TypeString,
Computed: true,
},

"tags": tags.Schema(),
},
}
Expand Down Expand Up @@ -144,6 +149,7 @@ func resourceArmDnsAaaaRecordRead(d *schema.ResourceData, meta interface{}) erro
d.Set("resource_group_name", resGroup)
d.Set("zone_name", zoneName)
d.Set("ttl", resp.TTL)
d.Set("fqdn", resp.Fqdn)

if err := d.Set("records", flattenAzureRmDnsAaaaRecords(resp.AaaaRecords)); err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions azurerm/resource_arm_dns_aaaa_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func TestAccAzureRMDnsAAAARecord_basic(t *testing.T) {
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMDnsAaaaRecordExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "fqdn"),
),
},
{
Expand Down
6 changes: 6 additions & 0 deletions azurerm/resource_arm_dns_caa_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ func resourceArmDnsCaaRecord() *schema.Resource {
Required: true,
},

"fqdn": {
Type: schema.TypeString,
Computed: true,
},

"tags": tags.Schema(),
},
}
Expand Down Expand Up @@ -171,6 +176,7 @@ func resourceArmDnsCaaRecordRead(d *schema.ResourceData, meta interface{}) error
d.Set("resource_group_name", resGroup)
d.Set("zone_name", zoneName)
d.Set("ttl", resp.TTL)
d.Set("fqdn", resp.Fqdn)

if err := d.Set("record", flattenAzureRmDnsCaaRecords(resp.CaaRecords)); err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions azurerm/resource_arm_dns_caa_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func TestAccAzureRMDnsCaaRecord_basic(t *testing.T) {
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMDnsCaaRecordExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "fqdn"),
),
},
{
Expand Down
6 changes: 6 additions & 0 deletions azurerm/resource_arm_dns_cname_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ func resourceArmDnsCNameRecord() *schema.Resource {
Required: true,
},

"fqdn": {
Type: schema.TypeString,
Computed: true,
},

"tags": tags.Schema(),
},
}
Expand Down Expand Up @@ -152,6 +157,7 @@ func resourceArmDnsCNameRecordRead(d *schema.ResourceData, meta interface{}) err
d.Set("resource_group_name", resGroup)
d.Set("zone_name", zoneName)
d.Set("ttl", resp.TTL)
d.Set("fqdn", resp.Fqdn)

if props := resp.RecordSetProperties; props != nil {
if record := props.CnameRecord; record != nil {
Expand Down
1 change: 1 addition & 0 deletions azurerm/resource_arm_dns_cname_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func TestAccAzureRMDnsCNameRecord_basic(t *testing.T) {
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMDnsCNameRecordExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "fqdn"),
),
},
{
Expand Down
6 changes: 6 additions & 0 deletions azurerm/resource_arm_dns_mx_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ func resourceArmDnsMxRecord() *schema.Resource {
Required: true,
},

"fqdn": {
Type: schema.TypeString,
Computed: true,
},

"tags": tags.Schema(),
},
}
Expand Down Expand Up @@ -160,6 +165,7 @@ func resourceArmDnsMxRecordRead(d *schema.ResourceData, meta interface{}) error
d.Set("resource_group_name", resGroup)
d.Set("zone_name", zoneName)
d.Set("ttl", resp.TTL)
d.Set("fqdn", resp.Fqdn)

if err := d.Set("record", flattenAzureRmDnsMxRecords(resp.MxRecords)); err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions azurerm/resource_arm_dns_mx_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func TestAccAzureRMDnsMxRecord_basic(t *testing.T) {
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMDnsMxRecordExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "fqdn"),
),
},
{
Expand Down
6 changes: 6 additions & 0 deletions azurerm/resource_arm_dns_ns_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ func resourceArmDnsNsRecord() *schema.Resource {
Required: true,
},

"fqdn": {
Type: schema.TypeString,
Computed: true,
},

"tags": tags.Schema(),
},
}
Expand Down Expand Up @@ -162,6 +167,7 @@ func resourceArmDnsNsRecordRead(d *schema.ResourceData, meta interface{}) error
d.Set("resource_group_name", resGroup)
d.Set("zone_name", zoneName)
d.Set("ttl", resp.TTL)
d.Set("fqdn", resp.Fqdn)

if err := d.Set("records", flattenAzureRmDnsNsRecords(resp.NsRecords)); err != nil {
return fmt.Errorf("Error settings `records`: %+v", err)
Expand Down
1 change: 1 addition & 0 deletions azurerm/resource_arm_dns_ns_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func TestAccAzureRMDnsNsRecord_basic(t *testing.T) {
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMDnsNsRecordExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "fqdn"),
),
},
{
Expand Down
6 changes: 6 additions & 0 deletions azurerm/resource_arm_dns_ptr_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ func resourceArmDnsPtrRecord() *schema.Resource {
Required: true,
},

"fqdn": {
Type: schema.TypeString,
Computed: true,
},

"tags": tags.Schema(),
},
}
Expand Down Expand Up @@ -145,6 +150,7 @@ func resourceArmDnsPtrRecordRead(d *schema.ResourceData, meta interface{}) error
d.Set("resource_group_name", resGroup)
d.Set("zone_name", zoneName)
d.Set("ttl", resp.TTL)
d.Set("fqdn", resp.Fqdn)

if err := d.Set("records", flattenAzureRmDnsPtrRecords(resp.PtrRecords)); err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions azurerm/resource_arm_dns_ptr_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func TestAccAzureRMDnsPtrRecord_basic(t *testing.T) {
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMDnsPtrRecordExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "fqdn"),
),
},
{
Expand Down
6 changes: 6 additions & 0 deletions azurerm/resource_arm_dns_srv_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ func resourceArmDnsSrvRecord() *schema.Resource {
Required: true,
},

"fqdn": {
Type: schema.TypeString,
Computed: true,
},

"tags": tags.Schema(),
},
}
Expand Down Expand Up @@ -168,6 +173,7 @@ func resourceArmDnsSrvRecordRead(d *schema.ResourceData, meta interface{}) error
d.Set("resource_group_name", resGroup)
d.Set("zone_name", zoneName)
d.Set("ttl", resp.TTL)
d.Set("fqdn", resp.Fqdn)

if err := d.Set("record", flattenAzureRmDnsSrvRecords(resp.SrvRecords)); err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions azurerm/resource_arm_dns_srv_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func TestAccAzureRMDnsSrvRecord_basic(t *testing.T) {
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMDnsSrvRecordExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "fqdn"),
),
},
{
Expand Down
6 changes: 6 additions & 0 deletions azurerm/resource_arm_dns_txt_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ func resourceArmDnsTxtRecord() *schema.Resource {
Required: true,
},

"fqdn": {
Type: schema.TypeString,
Computed: true,
},

"tags": tags.Schema(),
},
}
Expand Down Expand Up @@ -150,6 +155,7 @@ func resourceArmDnsTxtRecordRead(d *schema.ResourceData, meta interface{}) error
d.Set("resource_group_name", resGroup)
d.Set("zone_name", zoneName)
d.Set("ttl", resp.TTL)
d.Set("fqdn", resp.Fqdn)

if err := d.Set("record", flattenAzureRmDnsTxtRecords(resp.TxtRecords)); err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions azurerm/resource_arm_dns_txt_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func TestAccAzureRMDnsTxtRecord_basic(t *testing.T) {
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMDnsTxtRecordExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "fqdn"),
),
},
{
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/dns_a_record.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ The following arguments are supported:
The following attributes are exported:

* `id` - The DNS A Record ID.
* `fqdn` - The FQDN of the DNS A Record.

## Import

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/dns_aaaa_record.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ The following arguments are supported:
The following attributes are exported:

* `id` - The DNS AAAA Record ID.
* `fqdn` - The FQDN of the DNS AAAA Record.

## Import

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/dns_caa_record.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ The `record` block supports:
The following attributes are exported:

* `id` - The DNS CAA Record ID.
* `fqdn` - The FQDN of the DNS CAA Record.

## Import

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/dns_cname_record.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ The following arguments are supported:
The following attributes are exported:

* `id` - The DNS CName Record ID.
* `fqdn` - The FQDN of the DNS CName Record.

## Import

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/dns_mx_record.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ The `record` block supports:
The following attributes are exported:

* `id` - The DNS MX Record ID.
* `fqdn` - The FQDN of the DNS MX Record.

## Import

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/dns_ns_record.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ The `record` block supports:
The following attributes are exported:

* `id` - The DNS NS Record ID.
* `fqdn` - The FQDN of the DNS NS Record.

## Import

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/dns_ptr_record.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ The following arguments are supported:
The following attributes are exported:

* `id` - The DNS PTR Record ID.
* `fqdn` - The FQDN of the DNS PTR Record.

## Import

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/dns_srv_record.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ The `record` block supports:
The following attributes are exported:

* `id` - The DNS SRV Record ID.
* `fqdn` - The FQDN of the DNS SRV Record.

## Import

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/dns_txt_record.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ The `record` block supports:
The following attributes are exported:

* `id` - The DNS TXT Record ID.
* `fqdn` - The FQDN of the DNS TXT Record.

## Import

Expand Down