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

parsing the HostPool ID: the segment at position 6 didn't match #23363

Closed
1 task done
georgeollis opened this issue Sep 22, 2023 · 4 comments
Closed
1 task done

parsing the HostPool ID: the segment at position 6 didn't match #23363

georgeollis opened this issue Sep 22, 2023 · 4 comments

Comments

@georgeollis
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 and review the contribution guide to help.

Terraform Version

1.5.5

AzureRM Provider Version

3.74.0

Affected Resource(s)/Data Source(s)

azurerm_virtual_desktop_application_group

Terraform Configuration Files

resource "azurerm_virtual_desktop_application_group" "virtual_desktop_application_group" {
  name                         = var.name
  location                     = var.location
  resource_group_name          = var.resource_group_name
  default_desktop_display_name = var.default_desktop_display_name
  friendly_name                = var.friendly_name
  description                  = var.description
  host_pool_id                 = var.host_pool_id
  tags                         = var.tags
  type                         = var.type
}

Terraform TFVARS files with values

name = "test"
location = "uksouth"
type = "Desktop"
resource_group_name = "application_gateway_demo"
host_pool_id = "/subscriptions/xxxxxxx/resourceGroups/application_gateway_demo/providers/Microsoft.DesktopVirtualization/hostpools/test"

Debug Output/Panic Output

│ Error: parsing "/subscriptions/baba41cf-c01d-4a55-b6c5-ca494b802be5/resourceGroups/application_gateway_demo/providers/Microsoft.DesktopVirtualization/hostpools/test": parsing segment "staticHostPools": parsing the HostPool ID: the segment at position 6 didn't match

│ Expected a HostPool ID that matched:

│ > /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolValue

│ However, this value was provided:

│ > /subscriptions/baba41cf-c01d-4a55-b6c5-ca494b802be5/resourceGroups/application_gateway_demo/providers/Microsoft.DesktopVirtualization/hostpools/test

│ The parsed Resource ID was missing a value for the segment at position 6
│ (which should be the literal value "hostPools").



│   with azurerm_virtual_desktop_application_group.virtual_desktop_application_group,
│   on azurerm_virtual_desktop_application_group.tf line 8, in resource "azurerm_virtual_desktop_application_group" "virtual_desktop_application_group":
│    8:   host_pool_id                 = var.host_pool_id

Expected Behaviour

Should the host_pool_id value be using hostpools or hostPools? Currently, this is breaking deployments because getting the host pool resource ID via the Azure Portal using the following format:

/subscriptions/xxxxxx/resourceGroups/application_gateway_demo/providers/Microsoft.DesktopVirtualization/hostpools/test

image

However, Terraform is expecting it to use hostPools instead of hostpools.

Actual Behaviour

image

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@georgeollis georgeollis changed the title : parsing the HostPool ID: the segment at position 6 didn't match parsing the HostPool ID: the segment at position 6 didn't match Sep 22, 2023
@sinbai
Copy link
Contributor

sinbai commented Sep 26, 2023

Hi @georgeollis thanks for opening this issue. It is worth mentioning that Terraform provider replies on Azure Rest API to manage Azure resources. Because the host_pool_id returned by API contains hostPools instead of hostpool, it is by design that terraform provider requires the user to input the hostPools.

@georgeollis
Copy link
Author

georgeollis commented Sep 26, 2023

@sinbai If I create a Terraform host resource and output the host pool ID. It is returned as hostpools and not hostPools. Is that by design? If so, that doesn't work. If I deploy an application group resource, I need to specify a host_pool_id, which I would get by deploying the host pool resource, but I cannot specify the dependency because of the error. The application group can't use the host pool.

@georgeollis
Copy link
Author

It appears to be working now... thanks.

Copy link

github-actions bot commented May 6, 2024

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 May 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants