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 DNS alias support #2

Merged
merged 8 commits into from
Dec 11, 2019
Merged

Add DNS alias support #2

merged 8 commits into from
Dec 11, 2019

Conversation

matt-FFFFFF
Copy link
Owner

@matt-FFFFFF matt-FFFFFF commented Dec 11, 2019

Resources updated (including tests):

  • azurerm_dns_a_record
  • azurerm_dns_aaaa_record
  • azurerm_dns_cname_record

The other recordset types do not support aliases.

Other progress

  • docs

usage

resource "azurerm_dns_a_record" "alias" {
  name = "@"
  zone_name = azurerm_dns_zone.zone.name
  resource_group_name = azurerm_resource_group.rg.name
  ttl = 300

  /* Use the resource ID for a supported Azure resource here */
  target_resource_id = azurerm_frontdoor.site.id
} 

* A and AAAA record support for aliases
@matt-FFFFFF
Copy link
Owner Author

Acceptance tests for A records

 matt@DESKTOP-GCVSNIQ  ~/go/src/github.com/matt-FFFFFF/terraform-provider-azurerm   dnsalias  make testacc TESTARGS='-run=TestAccAzureRMDnsARecord'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor'|grep -v 'examples') -v -run=TestAccAzureRMDnsARecord -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
?       github.com/terraform-providers/terraform-provider-azurerm       [no test files]
=== RUN   TestAccAzureRMDnsARecord_basic
=== PAUSE TestAccAzureRMDnsARecord_basic
=== RUN   TestAccAzureRMDnsARecord_requiresImport
--- SKIP: TestAccAzureRMDnsARecord_requiresImport (0.00s)
    resource_arm_dns_a_record_test.go:43: Skipping since resources aren't required to be imported
=== RUN   TestAccAzureRMDnsARecord_updateRecords
=== PAUSE TestAccAzureRMDnsARecord_updateRecords
=== RUN   TestAccAzureRMDnsARecord_withTags
=== PAUSE TestAccAzureRMDnsARecord_withTags
=== RUN   TestAccAzureRMDnsARecord_withAlias
=== PAUSE TestAccAzureRMDnsARecord_withAlias
=== CONT  TestAccAzureRMDnsARecord_basic
=== CONT  TestAccAzureRMDnsARecord_withAlias
=== CONT  TestAccAzureRMDnsARecord_withTags
=== CONT  TestAccAzureRMDnsARecord_updateRecords
--- PASS: TestAccAzureRMDnsARecord_basic (82.44s)
--- PASS: TestAccAzureRMDnsARecord_updateRecords (99.21s)
--- PASS: TestAccAzureRMDnsARecord_withTags (101.57s)
--- PASS: TestAccAzureRMDnsARecord_withAlias (111.89s)
PASS

@matt-FFFFFF
Copy link
Owner Author

Acceptance tests for AAAA records

✘ matt@DESKTOP-GCVSNIQ  ~/go/src/github.com/matt-FFFFFF/terraform-provider-azurerm   dnsalias  make testacc TESTARGS='-run=TestAccAzureRMDnsAAAARecord'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor'|grep -v 'examples') -v -run=TestAccAzureRMDnsAAAARecord -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
?       github.com/terraform-providers/terraform-provider-azurerm       [no test files]
=== RUN   TestAccAzureRMDnsAAAARecord_basic
=== PAUSE TestAccAzureRMDnsAAAARecord_basic
=== RUN   TestAccAzureRMDnsAAAARecord_requiresImport
--- SKIP: TestAccAzureRMDnsAAAARecord_requiresImport (0.00s)
   resource_arm_dns_aaaa_record_test.go:43: Skipping since resources aren't required to be imported
=== RUN   TestAccAzureRMDnsAAAARecord_updateRecords
=== PAUSE TestAccAzureRMDnsAAAARecord_updateRecords
=== RUN   TestAccAzureRMDnsAAAARecord_withTags
=== PAUSE TestAccAzureRMDnsAAAARecord_withTags
=== RUN   TestAccAzureRMDnsAAAARecord_withAlias
=== PAUSE TestAccAzureRMDnsAAAARecord_withAlias
=== CONT  TestAccAzureRMDnsAAAARecord_basic
=== CONT  TestAccAzureRMDnsAAAARecord_withAlias
=== CONT  TestAccAzureRMDnsAAAARecord_withTags
=== CONT  TestAccAzureRMDnsAAAARecord_updateRecords
--- PASS: TestAccAzureRMDnsAAAARecord_basic (88.04s)
--- PASS: TestAccAzureRMDnsAAAARecord_withTags (102.99s)
--- PASS: TestAccAzureRMDnsAAAARecord_updateRecords (107.33s)
--- PASS: TestAccAzureRMDnsAAAARecord_withAlias (115.62s)
PASS

@matt-FFFFFF
Copy link
Owner Author

Acceptance tests for CNAME records

 ✘ matt@DESKTOP-GCVSNIQ  ~/go/src/github.com/matt-FFFFFF/terraform-provider-azurerm   dnsalias ●  make testacc TESTARGS='-run=TestAccAzureRMDnsCNameRecord'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor'|grep -v 'examples') -v -run=TestAccAzureRMDnsCNameRecord -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
?       github.com/terraform-providers/terraform-provider-azurerm       [no test files]
=== RUN   TestAccAzureRMDnsCNameRecord_basic
=== PAUSE TestAccAzureRMDnsCNameRecord_basic
=== RUN   TestAccAzureRMDnsCNameRecord_requiresImport
--- SKIP: TestAccAzureRMDnsCNameRecord_requiresImport (0.00s)
    resource_arm_dns_cname_record_test.go:43: Skipping since resources aren't required to be imported
=== RUN   TestAccAzureRMDnsCNameRecord_subdomain
=== PAUSE TestAccAzureRMDnsCNameRecord_subdomain
=== RUN   TestAccAzureRMDnsCNameRecord_updateRecords
=== PAUSE TestAccAzureRMDnsCNameRecord_updateRecords
=== RUN   TestAccAzureRMDnsCNameRecord_withTags
=== PAUSE TestAccAzureRMDnsCNameRecord_withTags
=== RUN   TestAccAzureRMDnsCNameRecord_withAlias
=== PAUSE TestAccAzureRMDnsCNameRecord_withAlias
=== CONT  TestAccAzureRMDnsCNameRecord_basic
=== CONT  TestAccAzureRMDnsCNameRecord_withTags
=== CONT  TestAccAzureRMDnsCNameRecord_updateRecords
=== CONT  TestAccAzureRMDnsCNameRecord_withAlias
--- PASS: TestAccAzureRMDnsCNameRecord_basic (83.34s)
=== CONT  TestAccAzureRMDnsCNameRecord_subdomain
--- PASS: TestAccAzureRMDnsCNameRecord_updateRecords (99.69s)
--- PASS: TestAccAzureRMDnsCNameRecord_withTags (104.40s)
--- PASS: TestAccAzureRMDnsCNameRecord_withAlias (108.71s)
--- PASS: TestAccAzureRMDnsCNameRecord_subdomain (79.74s)
PASS

@matt-FFFFFF matt-FFFFFF marked this pull request as ready for review December 11, 2019 17:33
@matt-FFFFFF matt-FFFFFF merged commit ec7fb85 into master Dec 11, 2019
matt-FFFFFF added a commit that referenced this pull request Jan 3, 2020
* Update DNS SDK to 2018-05-01
* A and AAAA record support for aliases

* Add missing }

* Update modules.txt and fix imports for dns tests

* Fic incorrect function name

* AAAA testacc pass! + improve resource read code:

* A
* CNAME
* AAAA

* Add CNAME tests

* Change CNAME tests to Zone Record Set

* Update docs
matt-FFFFFF pushed a commit that referenced this pull request Nov 28, 2021
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant