hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.6k stars 4.65k forks source link

Typo in azurerm_virtual_desktop_application_group resource id? #27633

Open mal-hue opened 1 month ago

mal-hue commented 1 month ago

Is there an existing issue for this?

Community Note

Terraform Version

~>1.9.0

AzureRM Provider Version

~> 3.108.0

Affected Resource(s)/Data Source(s)

azurerm_virtual_desktop_application_group

Terraform Configuration Files

resource "azurerm_role_assignment" "appgroup-users" {
  scope                = azurerm_virtual_desktop_application_group.applicationgroup.id
  role_definition_name = "Desktop Virtualization User"
  principal_id         = data.azuread_group.group_vm_users.object_id
}

Debug Output/Panic Output

-/+ resource "azurerm_role_assignment" "appgroup-users" {
      ~ id     = "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/p-rg-AVD-01/providers/Microsoft.DesktopVirtualization/applicationGroups/p-vdag-cuca-01/providers/Microsoft.Authorization/roleAssignments/db403519-5313-cc9f-3e66-3c20838f1279"

Expected Behaviour

The resource id string of the application group, as seen in the output panel above, should say .../applicationgroups/... As in the azure portal, the resource id for an application group is also written in lowercase for the word "applicationgroup"

/Microsoft.DesktopVirtualization/applicationgroups/p-vdag-cuca-01

Actual Behaviour

In the resource id string of the application group, as seen in the output panel above, it actually says .../applicationGroups/... So with a big "G" in "Groups"

Steps to Reproduce

No response

Important Factoids

No response

References

No response

sinbai commented 1 month ago

Hi @mal-hue thanks for opening this issue. I would like to explain that resource ids are uniformly named in camel case(applicationGroups) in Terraform, which is by design. It does not follow the naming convention of Portal. In addition, it is worth mentioning that Terraform manages resources through Azure Rest API. As you can see, the id of azurerm_virtual_desktop_application_group returned by API is also in camel case(applicationGroups) instead of all lower case(applicationgroups).

Give this is by design, could you please clarify what symptoms are causing the capitalization issue so we could see if there is a solution?