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

azurerm_synapse_managed_private_endpoint add private link service needs additional field FQDN #17305

Open schuhu opened 2 years ago

schuhu commented 2 years ago

Is there an existing issue for this?

Community Note

Terraform Version

1.2.2

AzureRM Provider Version

3.10.0

Affected Resource(s)/Data Source(s)

azurerm_synapse_managed_private_endpoint

Terraform Configuration Files

data "azurerm_private_link_service" "wan" {
  name                = "osdp-prod-wan"
  resource_group_name = "osdp-prod-wan-pls"
}
resource "azurerm_synapse_managed_private_endpoint" "wan" {
  name                 = "wan"
  synapse_workspace_id = azurerm_synapse_workspace.asa.id
  target_resource_id   = data.azurerm_private_link_service.wan.id
  subresource_name     = "" # empty according to the MS documentation
}

Debug Output/Panic Output

│ Error: creating Managed Private Endpoint: (Name "wan" / Managed Virtual Network Name "default" / Workspace Name "osdp-chbsynapse" / Resource Group "osdp-prod-asa-chbsynapse"): managedvirtualnetwork.ManagedPrivateEndpointsClient#Create: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="UnknownError" Message="{\"CorrelationId\":\"\",\"StatusCode\":400,\"Message\":\"Invalid Request: Message=Invalid payload received. FQDN needs to be specified for the private endpoint targeting Private Link Service: /subscriptions/f2e16b2d-d5a1-4930-8b71-e28493120107/resourceGroups/osdp-prod-wan-pls/providers/Microsoft.Network/privateLinkServices/osdp-prod-wan.\",\"ExceptionDetail\":\"Microsoft.Analytics.Clusters.Common.ClusterServiceException: Invalid payload received. FQDN needs to be specified for the private endpoint targeting Private Link Service: /subscriptions/f2e16b2d-d5a1-4930-8b71-e28493120107/resourceGroups/osdp-prod-wan-pls/providers/Microsoft.Network/privateLinkServices/osdp-prod-wan.\\r\\n ---> System.ArgumentException: FQDN needs to be specified for the private endpoint targeting Private Link Service: /subscriptions/f2e16b2d-d5a1-4930-8b71-e28493120107/resourceGroups/osdp-prod-wan-pls/providers/Microsoft.Network/privateLinkServices/osdp-prod-wan.\\r\\n   at Microsoft.Analytics.Clusters.Services.NetworkService.Contract.PrivateEndpointRequest.Validate(IServiceConfiguration conf, ILog logger) in C:\\\\source\\\\Services\\\\NetworkService\\\\Contracts\\\\DataContracts\\\\PrivateEndpointRequest.cs:line 205\\r\\n   at Microsoft.Analytics.Clusters.Services.NetworkService.StatefulBE.Controllers.NetworkController.AddPrivateEndpointAsync(String clientId, String privateEndpointReferenceName, PrivateEndpointRequest request) in C:\\\\source\\\\Services\\\\NetworkService\\\\NetworkServiceBE\\\\Controllers\\\\NetworkController.cs:line 258\\r\\n   --- End of inner exception stack trace ---\\r\\n   at Microsoft.Analytics.Clusters.Services.NetworkService.StatefulBE.Controllers.NetworkController.AddPrivateEndpointAsync(String clientId, String privateEndpointReferenceName, PrivateEndpointRequest request) in C:\\\\source\\\\Services\\\\NetworkService\\\\NetworkServiceBE\\\\Controllers\\\\NetworkController.cs:line 258\\r\\n   at lambda_method(Closure , Object )\\r\\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\\r\\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)\\r\\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\\r\\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\\r\\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\\r\\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\\r\\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\\r\\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\\r\\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\\r\\n   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)\\r\\n   at Microsoft.Analytics.Clusters.Services.NetworkService.StatefulBE.ActivePartitionInstanceMiddleware.InvokeAsync(HttpContext context) in C:\\\\source\\\\Services\\\\NetworkService\\\\NetworkServiceBE\\\\ActivePartitionInstanceMiddleware.cs:line 90\\r\\n   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<<UseMiddlewareInterface>b__1>d.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at Microsoft.Analytics.Clusters.Common.Web.ServiceFabricResourceNotFoundMiddleware.InvokeAsync(HttpContext httpContext) in C:\\\\source\\\\Shared\\\\Web\\\\ServiceFabricResourceNotFoundMiddleware.cs:line 50\\r\\n   at Microsoft.Analytics.Clusters.Common.Web.ExceptionMiddleware.InvokeAsync(HttpContext httpContext) in C:\\\\source\\\\Shared\\\\Web\\\\ExceptionMiddleware.cs:line 54\",\"ErrorType\":\"InvalidRequest\",\"ErrorNumber\":2190,\"ErrorOn\":\"2022-06-20T13:35:53.6620455+00:00\"}"
│ 
│   with module.azure-synapse-workspace.azurerm_synapse_managed_private_endpoint.wan,
│   on ../modules/azure-synapse-analytics/main.tf line 581, in resource "azurerm_synapse_managed_private_endpoint" "wan":
│  581: resource "azurerm_synapse_managed_private_endpoint" "wan" {
│

Expected Behaviour

Creation of the Private Link Service Managed Private Endpoint

Actual Behaviour

The above error is thrown.

Steps to Reproduce

Change the above code to your needs and apply it.

In the end, it's about the fqdns field missing and not configurable in tf, while mandatory by azure.

A successful config would look like this:

{ "name": "PrivateLinkService416", "properties": { "privateLinkResourceId": "/subscriptions/.../resourceGroups/osdp-prod-wan-pls/providers/Microsoft.Network/privateLinkServices/osdp-prod-wan", "groupId": "", "fqdns": [ "mysqlserver.example.com" ] } }

Important Factoids

No response

References

No response

sharccc commented 1 year ago

HashiCorp internal reference 120308 1173452908414427/1205281630385179 (Terraform Support)