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

New resource "azurerm_private_dns_zone_virtual_network_link" #3789

Merged
merged 6 commits into from
Sep 12, 2019

Conversation

tiwood
Copy link
Contributor

@tiwood tiwood commented Jul 4, 2019

  • New resource "azurerm_private_dns_zone_virtual_network_link"
  • Add tests
  • Documentation

azurerm_private_dns_zone_virtual_network_link

Enables you to manage Private DNS zone Virtual Network Links. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS.

Example Usage

resource "azurerm_resource_group" "test" {
  name     = "acceptanceTestResourceGroup1"
  location = "West US"
}

resource "azurerm_private_dns_zone" "test" {
  name                = "mydomain.com"
  resource_group_name = "${azurerm_resource_group.test.name}"
}

resource "azurerm_private_dns_zone_virtual_network_link" "test" {
  name                  = "test"
  resource_group_name   = azurerm_resource_group.test.name
  private_dns_zone_name = azurerm_private_dns_zone.test.name
  virtual_network_id    = azurerm_virtual_network.test.id
}

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the Private DNS Zone Virtual Network Link. Changing this forces a new resource to be created.

  • private_dns_zone_name - (Required) The name of the Private DNS zone (without a terminating dot). Changing this forces a new resource to be created.

  • virtual_network_id - (Required) The Resource ID of the Virtual Network that should be linked to the DNS Zone. Changing this forces a new resource to be created.

  • registration_enabled - (Optional) Is auto-registration of virtual machine records in the virtual network in the Private DNS zone enabled? Defaults to false.

  • resource_group_name - (Required) Specifies the resource group where the resource exists. Changing this forces a new resource to be created.

  • tags - (Optional) A mapping of tags to assign to the resource.

TODO

  • The resources work as expected (create/update/delete) but tests currently fail - possibly due to Timing/Replication issues.

Fixes #3758

@tiwood
Copy link
Contributor Author

tiwood commented Jul 4, 2019

Closes #3758

@DonEstefan
Copy link

I guess this patch should contain some code to deprecate the following arguments of the azurerm_dns_zone resource:

  • registration_virtual_network_ids
  • resolution_virtual_network_ids
  • zone_type

@williamoverton
Copy link

Any update on this? Still having to use the deprecated "zone_type" field in the azurerm_dns_zone provider :(

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @tiwood

Thanks for this PR - apologies for the delayed review here, with this being marked as a WIP PR I'd missed this wasn't ready for review - sorry!

Taking a look through this mostly LGTM - if we can fix up the comments then this otherwise should be good to merge; since this looks good so that we can get this merged into the 1.34 release, I hope you don't mind but I'm going to push some commits to fix those comments.

Thanks!

@tombuildsstuff tombuildsstuff marked this pull request as ready for review September 12, 2019 12:15
tiwood and others added 5 commits September 12, 2019 19:01
… it's gone

```
$ acctests azurerm TestAccAzureRMPrivateDnsZoneVirtualNetworkLink_
=== RUN   TestAccAzureRMPrivateDnsZoneVirtualNetworkLink_basic
=== PAUSE TestAccAzureRMPrivateDnsZoneVirtualNetworkLink_basic
=== RUN   TestAccAzureRMPrivateDnsZoneVirtualNetworkLink_requiresImport
--- SKIP: TestAccAzureRMPrivateDnsZoneVirtualNetworkLink_requiresImport (0.00s)
    resource_arm_private_dns_zone_virtual_network_link_test.go:42: Skipping since resources aren't required to be imported
=== RUN   TestAccAzureRMPrivateDnsZoneVirtualNetworkLink_withTags
=== PAUSE TestAccAzureRMPrivateDnsZoneVirtualNetworkLink_withTags
=== CONT  TestAccAzureRMPrivateDnsZoneVirtualNetworkLink_basic
--- PASS: TestAccAzureRMPrivateDnsZoneVirtualNetworkLink_basic (226.26s)
=== CONT  TestAccAzureRMPrivateDnsZoneVirtualNetworkLink_withTags
--- PASS: TestAccAzureRMPrivateDnsZoneVirtualNetworkLink_withTags (372.72s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	599.035s
```
@tombuildsstuff
Copy link
Contributor

Rebased this / fixed up the tests (when running I noticed the Read function called the Private DNS Zone Read function rather than the Virtual Network Link Read; and that the API appears to return that the Virtual Network Link's been deleted before it's actually gone)

@tombuildsstuff
Copy link
Contributor

tombuildsstuff commented Sep 12, 2019

Tests pass:

Screenshot 2019-09-12 at 19 38 33

Thanks for this @tiwood :)

@tombuildsstuff tombuildsstuff merged commit bfc1607 into hashicorp:master Sep 12, 2019
tombuildsstuff added a commit that referenced this pull request Sep 12, 2019
@ghost
Copy link

ghost commented Sep 18, 2019

This has been released in version 1.34.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.34.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Oct 13, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Oct 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

virtualNetworkLinks for privateDnsZone
4 participants