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.64k forks source link

Express route connection - InvalidJson: Could not find member enablePrivateLinkFastPath #26039

Open jschul711 opened 5 months ago

jschul711 commented 5 months ago

Is there an existing issue for this?

Community Note

Terraform Version

1.8.3

AzureRM Provider Version

3.104.2

Affected Resource(s)/Data Source(s)

azurerm_express_route_connection

Terraform Configuration Files

# plan output

# module.platform_foundation.azurerm_express_route_connection.vwan_express_route_connection["avs"] will be updated in-place
  ~ resource "azurerm_express_route_connection" "vwan_express_route_connection" {
      ~ enable_internet_security             = false -> true
        id                                   = "valid ID"
        name                                 = "sikg-cf-prod-exprc-avs"
        # (6 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

# tf code

resource "azurerm_express_route_connection" "vwan_express_route_connection" {
  provider                         = azurerm.connectivity
  for_each                         = var.connectivity_express_route_connections
  express_route_circuit_peering_id = length(split("/", each.value.express_route_circuit)) > 1 ? "${each.value.express_route_circuit}/peerings/AzurePrivatePeering" : azurerm_express_route_circuit_peering.express_route_peering[each.key].id
  express_route_gateway_id         = azurerm_express_route_gateway.vwan_express_route_gateway[each.value.region].id
  name                             = "${var.customer}-${var.project}-${var.environment}-exprc-${each.key}"
  authorization_key                = length(split("/", each.value.express_route_circuit)) > 1 ? each.value.authorization_key : azurerm_express_route_circuit_authorization.authorization[each.key].authorization_key
  enable_internet_security         = each.value.enable_internet_security
}

Debug Output/Panic Output

│ Error: updating Express Route Connection: (Name "sikg-cf-prod-exprc-avs" / Express Route Gateway Name "sikg-cf-prod-ergw-euw" / Resource Group "sikg-cf-prod-rg-connectivity"): network.ExpressRouteConnectionsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidRequestFormat" Message="Cannot parse the request." Details=[{"code":"InvalidJson","message":"Could not find member 'enablePrivateLinkFastPath' on object of type 'ExpressRouteConnectionProperties'. Path 'properties.enablePrivateLinkFastPath', line 1, position 163."}]
│ 
│   with module.platform_foundation.azurerm_express_route_connection.vwan_express_route_connection["avs"],
│   on .terraform/modules/platform_foundation/202_expressRoute.tf line 48, in resource "azurerm_express_route_connection" "vwan_express_route_connection":
│   48: resource "azurerm_express_route_connection" "vwan_express_route_connection" {

Expected Behaviour

The express route connection should have internet security enabled when apply is finshed.

Actual Behaviour

Error as it is given in the error output is returned. For azurerm v3.99 it worked as expected.

Steps to Reproduce

Take an existing express route connection, as given above and change the value for enable_internet_security to true.

Important Factoids

No response

References

No response

xuzhang3 commented 5 months ago

The private_link_fast_path_enabled was introduces since v3.100.0 #25596 , which appears to have introduced this issue.

marcusit commented 5 months ago

I get this same error even with the most basic config, so changing "enable_internet_security" might just be coincidental.

Terraform Version 1.7.4

AzureRM Provider Version 3.106.1

resource "azurerm_express_route_connection" "hub-ergw-con" {
  name                             = "ergwcon-${var.environment}-${var.location}-transit"
  express_route_gateway_id         = azurerm_express_route_gateway.hub-ergw.id
  express_route_circuit_peering_id = var.erc-peer-id
  authorization_key                = var.erc-auth-key
}

Error: creating Express Route Connection: (Name "ergwcon-prod-eastus-transit" / Express Route Gateway Name "ergw-prod-eastus-transit" / Resource Group "rg-prod-eastus-transit"): network.ExpressRouteConnectionsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidRequestFormat" Message="Cannot parse the request." Details=[{"code":"InvalidJson","message":"Could not find member 'enablePrivateLinkFastPath' on object of type 'ExpressRouteConnectionProperties'. Path 'properties.enablePrivateLinkFastPath', line 1, position 169."}]

adammontlake commented 4 weeks ago

This is still true for AzureRM version 4.5.0 Here is the error output message:

2024-10-13T12:08:06.120+0300 [DEBUG] provider.terraform-provider-azurerm_v4.5.0_x5.exe: {"error":{"code":"InvalidRequestFormat","message":"Cannot parse the request.","details":[{"code":"InvalidJson","message":"Could not find member 'enablePrivateLinkFastPath' on object of type 'ExpressRouteConnectionProperties'. Path 'properties.enablePrivateLinkFastPath', line 1, position 148."}]}} 2024-10-13T12:08:06.120+0300 [ERROR] provider.terraform-provider-azurerm_v4.5.0_x5.exe: Response contains error diagnostic: @caller=github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_detail="" diagnostic_severity=ERROR diagnostic_summary= | creating Express Route Connection (Subscription: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" | Resource Group Name: "rg-name" | Express Route Gateway Name: "eeeeeee-westus2-er-gw" | Express Route Connection Name: "con-ER-333333333333-westus2-er-gw"): performing CreateOrUpdate: unexpected status 400 (400 Bad Request) with error: InvalidRequestFormat: Cannot parse the request. tf_proto_version=5.6 tf_provider_addr=registry.terraform.io/hashicorp/azurerm tf_req_id=aaaaaaaaa tf_resource_type=azurerm_express_route_connection tf_rpc=ApplyResourceChange timestamp="2024-10-13T12:08:06.120+0300"

This is same issue as reported here, but it was not fixed in v3.116. I tested v116 as well and showing the same error

xuzhang3 commented 3 weeks ago

I temporarily remove private_link_fast_path_enabled as a workaround in my env as a workaround. This property does not seem to be supported by the service