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

azurerm_network_service_tags does not work for globally deployed resources (e.g. FrontDoor) #26428

Closed
1 task done
hilariocoelho opened this issue Jun 21, 2024 · 0 comments · Fixed by #26429
Closed
1 task done

Comments

@hilariocoelho
Copy link
Contributor

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 comments along the lines of "+1", "me too" or "any updates", 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 and review the contribution guide to help.

Terraform Version

1.7.5

AzureRM Provider Version

3.109.0

Affected Resource(s)/Data Source(s)

azurerm_network_service_tags

Terraform Configuration Files

data "azurerm_network_service_tags" "az_fd_frontend" {
  service  = "AzureFrontDoor.Frontend"
  location = "northeurope"
}

Debug Output/Panic Output

Condensed log showing the full response from the Azure service tag API (including the service tag `AzureFrontDoor.Frontend`):
https://gist.github.com/hilariocoelho/145c7e4c03839066248d50fad3d8372d

Expected Behaviour

The data source should've returned the list of address prefixes that are listed under the service tag AzureFrontDoor.Frontend.

Actual Behaviour

│ Error: specified service tag `AzureFrontDoor.Frontend` not found globally
│ 
│   with data.azurerm_network_service_tags.az_fd_frontend,
│   on main.tf line 16, in data "azurerm_network_service_tags" "az_fd_frontend":
│   16: data "azurerm_network_service_tags" "az_fd_frontend" {

Steps to Reproduce

  1. Create a file with the above data source in (exactly as it is there)
  2. terraform apply

Important Factoids

I can't specify wich Tag to use Backend vs Frontend vs FirstParty and by default the provider uses AzureFrontDoor.Backend tag.

References

This issue is very similar to #9156 but in this case I would like to data source Frontend tag

I believe this is due to how the function isServiceTagOf works. It is only validating the first element after the strings.Split(stName, ".").

I returned service tags are alphabetically sorted so the first match should be AzureFrontDoor.Backend and the list of CIDR Ranges will be returned here. This is why by default the returned IPs are from Backend service tag

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