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

Bug: Private DNS Zone resource ID named dnszones and not dnsZones #909

Closed
tobiasehlert opened this issue Mar 4, 2024 · 1 comment · Fixed by #910
Closed

Bug: Private DNS Zone resource ID named dnszones and not dnsZones #909

tobiasehlert opened this issue Mar 4, 2024 · 1 comment · Fixed by #910

Comments

@tobiasehlert
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Versions

terraform: 1.7.4

azure provider: 3.94.0

module: 5.1.0

Description

Describe the bug

The azurerm_dns_zone resource created by the terraform-azurerm-caf-enterprise-scale module does use dnszones and not dnsZones in the key name.

Since all resources in the Terraform state use the Resource ID of the resource in Azure, the ID should reflect the lowercase and uppercase naming as expected by the Terraform Azure provider.

╷
│ Error: parsing "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnszones/dnsZoneValue": parsing segment "staticDnsZones": parsing the DnsZone ID: the segment at position 6 didn't match
│ 
│ Expected a DnsZone ID that matched:
│ 
│ > /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneValue
│ 
│ However this value was provided:
│ 
│ > /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnszones/dnsZoneValue
│ 
│ The parsed Resource ID was missing a value for the segment at position 6
│ (which should be the literal value "dnsZones").
│ 
╵

Steps to Reproduce

  1. Import Terraform state for a public zone (based on Terraform state key) that fails:
    terraform import 'module.enterprise_scale.azurerm_dns_zone.connectivity["/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnszones/dnsZoneValue"]' /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnszones/dnsZoneValue
  2. Import Terraform state for a public zone (based on correct Resource ID) that works:
    terraform import 'module.enterprise_scale.azurerm_dns_zone.connectivity["/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnszones/dnsZoneValue"]' /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneValue

Screenshots

Additional context

@tobiasehlert tobiasehlert changed the title Bug Report Bug: Private DNS Zone resource ID named dnszones and not dnsZones Mar 4, 2024
@matt-FFFFFF
Copy link
Member

I saw something similar myself, I think it's a new version of the provider that has done this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants