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

Terraform plan with azurerm_dns_a_record fails when parsing existing dns record with azurerm 3.19.0 #18039

Closed
1 task done
abreunig359 opened this issue Aug 19, 2022 · 24 comments · Fixed by #18048
Closed
1 task done

Comments

@abreunig359
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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

Terraform Version

0.14.10

AzureRM Provider Version

3.19.0

Affected Resource(s)/Data Source(s)

azurerm_dns_a_record

Terraform Configuration Files

resource "azurerm_dns_a_record" "a_record" {
  name = "dns_name"
  records = [
    kubernetes_service.service_name.status[0].load_balancer[0].ingress[0].ip
  ]
  resource_group_name = "resource_group_name"
  ttl                 = 3600
  zone_name           = "zone_name"

  tags = local.tags
}

Debug Output/Panic Output

Error: parsing "/subscriptions/uuid/resourceGroups/resourceGroup/providers/Microsoft.Network/dnszones/dnszone/A/record": parsing segment "staticDnsZones": expected the segment "dnszones" to be "dnsZones"

Expected Behaviour

Terraform plan should finish successfully.
With azurerm 3.18.0 it works fine.
There where no changes to the dns config, aside from upgrading the provider version to 3.19.0

Actual Behaviour

Terraform plan fails with parsing error.

Steps to Reproduce

Run terraform plan or terraform apply with an existing dns_a_record after upgrading to azurerm 3.19.0

Important Factoids

No response

References

No response

@github-actions github-actions bot removed the bug label Aug 19, 2022
@abreunig359 abreunig359 changed the title Terraform plan fails when parsing existing dns record with azurerm 3.19.0 Terraform plan with azurerm_dns_a_record fails when parsing existing dns record with azurerm 3.19.0 Aug 19, 2022
@wiebeck
Copy link
Contributor

wiebeck commented Aug 19, 2022

Same for CNAME record with provider version 3.19.0.

@hamza-tumturk
Copy link

hamza-tumturk commented Aug 19, 2022

Same here, this started being an issue in the new provider version v3.19.0 for us as well.

@domenicomastrangelo
Copy link

I pushed a PR just now #18044

@hamza-tumturk
Copy link

@domenicomastrangelo is there any workaround available until release of the fix?

@domenicomastrangelo
Copy link

@hamza-tumturk you could downgrade the image to 3.18.0 as that seems to be working correctly

@epopisces
Copy link

Same with azurerm_dns_zone also:

Error: parsing "/subscriptions/$subID/resourceGroups/rg-platformx-stg/providers/Microsoft.Network/dnszones/$dnsZone": parsing segment "staticDnsZones": expected the segment "dnszones" to be "dnsZones"

│   with azurerm_dns_zone.this,

@Amier3
Copy link
Contributor

Amier3 commented Aug 19, 2022

Hey @abreunig359

Thanks for the report and thanks to @domenicomastrangelo for the quick PR! We appreciate everyone adding context and upvoting this. We'll have to review and test the PR to see if it fully solves the root cause of the bug, but we'll keep everyone here updated once that's figured out.

As far as workarounds go, I recommend downgrading to 3.18.0 if this is affecting anyones environment.

@Amier3
Copy link
Contributor

Amier3 commented Aug 19, 2022

We've PR'd a fix in #18048 and will be rolling out a point release shortly.

@github-actions github-actions bot added this to the v3.19.0 milestone Aug 19, 2022
@Amier3 Amier3 unpinned this issue Aug 19, 2022
@MarkDeVerno
Copy link

This is still happening for CNAME records:

Error: parsing "/subscriptions/cd25a667-aee9-4704-be53-9c99a1008b55/resourceGroups/rg-dns/providers/Microsoft.Network/dnszones/mydns.com/CNAME/my_app": parsing segment "staticDnsZones": expected the segment "dnszones" to be "dnsZones"

@github-actions
Copy link

This functionality has been released in v3.19.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@stusklinar
Copy link

This is still happening for CNAME records:

Error: parsing "/subscriptions/cd25a667-aee9-4704-be53-9c99a1008b55/resourceGroups/rg-dns/providers/Microsoft.Network/dnszones/mydns.com/CNAME/my_app": parsing segment "staticDnsZones": expected the segment "dnszones" to be "dnsZones"

New issue opened here for v3.19.1

#18104

@vishalsinha21
Copy link

We are using azurerm version 3.23.0 and faced this issue while deleting an A record. I thought this has been fixed in version 3.19.1 and shouldn't be happening in the higher versions 🤔

Error: parsing "/subscriptions/***": parsing segment "staticDnsZones": expected the segment "dnszones" to be "dnsZones"

@jaritimonen
Copy link

Having this issue also with 3.23.0

@iqmetrix-cloudops
Copy link

Having this issue also with 3.24.0!

@LeePorte
Copy link

LeePorte commented Oct 4, 2022

Still seeing this issue with 3.25.0

@kevinscollins
Copy link

We're having it with 3.26.0 as well

@ctienshi
Copy link

Issue is fixed with 3.27.0.

@TommyBeaton
Copy link

TommyBeaton commented Oct 17, 2022

Just tried this and I'm still getting the same issue for CNAME with v 3.27.0 :'(
I've changed over to v 3.18.0 and that has fixed the problem for me.

@tombuildsstuff
Copy link
Contributor

@TommyBeaton if you're still seeing this in the most recent version of the provider you'll need to ensure the Resource ID being provided is in the correct format, the state migration will only fix existing resources upgrading to the new version - if the casing is defined incorrectly in the config you'll need to update this per the validation error message being returned.

@TommyBeaton
Copy link

TommyBeaton commented Oct 17, 2022

I'm just pulling the resource ID from a resource declared above it namespace_id = azurerm_servicebus_namespace.foo.id. So surely it will already be in the correct format?

@tombuildsstuff
Copy link
Contributor

@TommyBeaton this issue's related to DNS Records, there isn't a field for Namespace ID in the DNS Resources, so this must be related to another resource?

@TommyBeaton
Copy link

Sorry, that was related to another issue I had earlier today 😅 Will investigate now

@kevinscollins
Copy link

@tombuildsstuff - this worked for me, thank you! 🙏

@github-actions
Copy link

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 have found a problem that seems similar to this, 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 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.