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.52k stars 4.6k forks source link

Support for Private Link Service in azurerm_data_factory_managed_private_endpoint #14310

Closed vojtechDB closed 2 years ago

vojtechDB commented 2 years ago

Community Note

Terraform (and AzureRM Provider) Version

Terraform v1.0.11 on linux_amd64

Affected Resource(s)

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

resource "azurerm_data_factory_managed_private_endpoint" "general" {
  name               = "example"
  data_factory_id    = var.data_factory_id
  target_resource_id = var.target_resource_id
  subresource_name   = ""
}

Debug Output

╷ │ Error: subresource_name must be at least 3 character in length │ │ with azurerm_data_factory_managed_private_endpoint.general, │ on main.tf line 172, in resource "azurerm_data_factory_managed_private_endpoint" "general": │ 172: subresource_name = "" │ ╵

Panic Output

Expected Behaviour

New managed private endpoint (Private Link Service) in Data factory is created

Actual Behaviour

Resource is not created because subresource_name parameter in TF resource must be defined

Steps to Reproduce

  1. terraform apply

Important Factoids

References

As per MS documentation https://docs.microsoft.com/en-us/azure/private-link/private-endpoint-overview#private-link-resource the Subresource parameter for Private Link Service is empty

vojtechDB commented 2 years ago

An example of az cli command which works. fqdns parameter must be specified too

resource "null_resource" "general" {
  provisioner "local-exec" {

    command = <<EOH
      az datafactory managed-private-endpoint create \
         --managed-virtual-network-name "default" \
         --resource-group "${var.data_factory_resource-group}" \
         --factory-name "${var.data_factory_name}" \
         --private-link-resource-id "${var.target_resource_id}" \
         --name "example" \
         --fqdns "example.io.de"
    EOH
  }
ms-zhenhua commented 2 years ago

Thank you for reaching out. For private link service, subresource_name is not needed and fqdns is a required field. I am working on it with a new pull request. An example of configuration for private link service may look like this in future release:

resource "azurerm_data_factory_managed_private_endpoint" "test" {
  name               = "acctestEndpoint1"
  data_factory_id    = azurerm_data_factory.test.id
  target_resource_id = azurerm_private_link_service.test.id
  fqdns = ["x.x.x.x.x"]
}

Thank you for reporting this issue.

github-actions[bot] commented 2 years ago

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.