-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Unable to reference data block for azurerm_private_dns_zone: "Parent resource '...' not found" #7993
Comments
@fcatacut, thanks for opening this issue. After investigated, I suspect you are using incorrect resource group name while creating private dns zone virtual network link. You have to use the resource group where the Private DNS Zone exists while creating vnet link. I think it's just a document issue. So I made a fix for it. Sample code:
|
As noted in Step 2 of the "Steps to Reproduce" section, |
@fcatacut, I assume below repro steps is the same with what you described above, right? If yes, could you have a try below my tfconfig which is similar with yours to check whether the issue still exists since I cannot repro this issue with below tfconfig? Thanks.
Result:
Result:
|
For #2, replace the
|
Sorry, long morning. I finally realized what you pointed out in your initial response. The link has to be in the same resource group as the Private DNS Zone. |
Yes. That’s right. You got my point. |
This has been released in version 2.22.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 = "~> 2.22.0"
}
# ... other configuration ... |
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! |
I'm trying to use a data-block to retrieve an existing Private DNS zone so that it can be referenced when creating additional resources, such as
azurerm_private_dns_zone_virtual_network_link
andazurerm_private_dns_a_record
.Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.12.29
Affected Resource(s)
azurerm_private_dns_zone
Terraform Configuration Files
Debug Output
https://gist.github.com/fcatacut/59b3005ef022f629502d8f6d6cc4ce41
Panic Output
Expected Behavior
azurerm_private_dns_zone_virtual_network_link
should be successfully created.Actual Behavior
Steps to Reproduce
privatelink.documents.azure.com
is used.<change me>
references to the Name of the Resource Group containing the Private DNS zone.terraform apply
Important Factoids
Commenting out the
azurerm_private_dns_zone_virtual_network_link
resource block yields the expected output:The text was updated successfully, but these errors were encountered: