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

resource type Microsoft.Compute/diskAccesses not allowed in azurerm_private_endpoint creation in subresource_names list #28393

Open
1 task done
EladEdut opened this issue Dec 29, 2024 · 0 comments

Comments

@EladEdut
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 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.9.3

AzureRM Provider Version

4.12.0

Affected Resource(s)/Data Source(s)

azurerm_private_endpoint

Terraform Configuration Files

resource "azurerm_managed_disk" "disk" {
  name                 = local.disk_name
  location             = data.azurerm_resource_group.env_rg.location
  resource_group_name  = data.azurerm_resource_group.env_rg.name
  storage_account_type = "Standard_LRS"
  create_option        = "Empty"
  disk_size_gb         = var.aks_configuration.rmq_disk_size_gb
  
  tags = var.tags
}

resource "azurerm_disk_access" "disk_access" {
  name                 = "${local.disk_name}-access"
  location             = data.azurerm_resource_group.env_rg.location
  resource_group_name  = data.azurerm_resource_group.env_rg.name
}

resource "azurerm_private_endpoint" "private_endpoint" {
  name                = "${local.disk_name}-private-endpoint"
  location            = var.location
  resource_group_name = data.azurerm_resource_group.env_rg.name
  subnet_id           = data.azurerm_subnet.shared.id

  private_service_connection {
    name                           = "${local.disk_name}-connection"
    private_connection_resource_id = azurerm_disk_access.disk_access.id
    subresource_names              = ["Microsoft.Compute/diskAccesses"]
    is_manual_connection           = false
  }
}

Debug Output/Panic Output

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: private_service_connection.0.subresource_names.0 must begin and end with a alphanumeric character, be between 3 and 63 characters in length, only contain letters, numbers, underscores, periods, and dashes
│ 
│   with azurerm_private_endpoint.private_endpoint,
│   on pv-disk.tf line 30, in resource "azurerm_private_endpoint" "private_endpoint":
│   30:     subresource_names              = ["Microsoft.Compute/diskAccesses"]
│ 
╵

Expected Behaviour

allow to create the private endpoint with attachment to the disk access resource, with this allowed subresource name. (documented here https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-overview#private-link-resource)

Actual Behaviour

fail

Steps to Reproduce

tf apply

Important Factoids

No response

References

No response

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

No branches or pull requests

1 participant