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

Name in private_service_connection block for azurerm_private_endpoint does not work #23925

Open
1 task done
dipendra-singh opened this issue Nov 16, 2023 · 2 comments
Open
1 task done

Comments

@dipendra-singh
Copy link

dipendra-singh commented Nov 16, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

The name provided in the private_service_connection block is not respected when creating the privateEndpointConnections.
I created the private endpoint with private_service_connection block as following:

  location            = var.location
  name                = var.eventhub_pep_name
  resource_group_name = var.rg_name
  subnet_id           = var.eventhub_subnet_id

  private_service_connection {
    is_manual_connection           = true
    name                           = var.eventhub_pep_psc_name
    private_connection_resource_id = azurerm_eventhub_namespace.eventhub_namespace.id
    request_message                = "Please approve"
    subresource_names              = ["namespace"]
  }
}

but when I do

az network private-endpoint-connection list  -g <rg_name> -n <eventhub_namespace> --type Microsoft.EventHub/namespaces

I get some random string in the privateEndpointConnection's name field.

Terraform Version

1.6.4

AzureRM Provider Version

3.80.0

Affected Resource(s)/Data Source(s)

azurerm_private_endpoint

Terraform Configuration Files

resource "azurerm_private_endpoint" "eventhub_pep" {
  location            = "eastus"
  name                = "eh-pep-name"
  resource_group_name = "myrg"
  subnet_id           = var.eventhub_subnet_id

  private_service_connection {
    is_manual_connection           = true
    name                           = "eh-pep-psc-name"
    private_connection_resource_id = azurerm_eventhub_namespace.eventhub_namespace.id
    request_message                = "Please approve"
    subresource_names              = ["namespace"]
  }
}

Debug Output/Panic Output

[
  {
    "id": "/subscriptions/xxxx/resourceGroups/rrrrrrrggggg/providers/Microsoft.EventHub/namespaces/abcdefgh/privateEndpointConnections/idddddddddd",
    "location": "eastus",
    "name": "778f53db-3e87-4d3d-a134-9f8168c14089",
    "properties": {
      "groupIds": [
        "namespace"
      ],
      "privateEndpoint": {
        "id": "<id>",
        "resourceGroup": "<rg>"
      },
      "privateLinkServiceConnectionState": {
        "description": "Please approve",
        "status": "Pending"
      },
      "provisioningState": "Succeeded"
    },
    "resourceGroup": "<rg>",
    "type": "Microsoft.EventHub/Namespaces/PrivateEndpointConnections"
  }
]

Expected Behaviour

name to have value var.eventhub_pep_psc_name

Actual Behaviour

name has random string in the privateEndpointConnection

Steps to Reproduce

  1. Required: existing eventhub namespace, subnet, resource group.
  2. import the namespace as data.
  3. Replace a few field in the resource block mentioned above
  4. apply terraform

Important Factoids

No response

References

No response

@favoretti
Copy link
Collaborator

Hi there and thank you for reporting this. I can't reproduce this to be honest. Did you try approving the connection? Potentially the name would be set after the approval? I have a ton of these all over the place, and name is set properly everywhere.

@dipendra-singh
Copy link
Author

dipendra-singh commented Dec 6, 2023

I get that the name might be set post approval, but what I am trying to do here is that I am trying to approve the private endpoints programatically. Ideally, if I am providing a name to an endpoint or a private_service_connection, it should be reflected in the resource and not wait for an approval.
@favoretti

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

3 participants