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

azurerm_virtual_network_gateway resource causes panic when vpn_client_configuration block is specified #28138

Closed
1 task done
odee30 opened this issue Nov 28, 2024 · 2 comments

Comments

@odee30
Copy link

odee30 commented Nov 28, 2024

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.8

AzureRM Provider Version

4.11.0

Affected Resource(s)/Data Source(s)

azurerm_virtual_network_gateway

Terraform Configuration Files

terraform {
  required_version = "= 1.9.8"

  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "4.11.0"
    }
  }
}

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "this" {
  name     = "rg-example"
  location = "uksouth"
}

resource "azurerm_virtual_network" "this" {
  name                = "vnet-example"
  resource_group_name = azurerm_resource_group.this.name
  location            = azurerm_resource_group.this.location
  address_space       = ["10.0.0.0/16"]
}

resource "azurerm_subnet" "this" {
  name                 = "GatewaySubnet"
  resource_group_name  = azurerm_resource_group.this.name
  virtual_network_name = azurerm_virtual_network.this.name
  address_prefixes     = ["10.0.0.0/27"]
}

resource "azurerm_public_ip" "this" {
  name                = "pip-example"
  resource_group_name = azurerm_resource_group.this.name
  location            = azurerm_resource_group.this.location
  allocation_method   = "Dynamic"
  sku                 = "Basic"
}

resource "azurerm_virtual_network_gateway" "this" {
  name                = "vgw-example"
  resource_group_name = azurerm_resource_group.this.name
  location            = azurerm_resource_group.this.location
  type                = "Vpn"
  vpn_type            = "RouteBased"
  sku                 = "Basic"

  ip_configuration {
    name                          = "ipconfig-example"
    subnet_id                     = azurerm_subnet.this.id
    private_ip_address_allocation = "Dynamic"
    public_ip_address_id          = azurerm_public_ip.this.id
  }

  vpn_client_configuration {
    address_space = ["10.0.1.0/24"]
  }
}

Debug Output/Panic Output

Error: Plugin did not respond
│ 
│   with azurerm_virtual_network_gateway.this,
│   on main.tf line 43, in resource "azurerm_virtual_network_gateway" "this":
│   43: resource "azurerm_virtual_network_gateway" "this" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-azurerm_v4.11.0_x5 plugin:

panic: interface conversion: interface {} is *schema.Set, not []interface {}

goroutine 417 [running]:
github.com/hashicorp/terraform-provider-azurerm/internal/services/network.expandVirtualNetworkGatewayVpnClientConfig(0xe1cc720?, {{0xc000084014, 0x24}, {0xc002ffded0, 0xa}, {0xc002ffdeb4, 0xb}})
        github.com/hashicorp/terraform-provider-azurerm/internal/services/network/virtual_network_gateway_resource.go:1096 +0x1ae5
github.com/hashicorp/terraform-provider-azurerm/internal/services/network.getVirtualNetworkGatewayProperties({{0xc000084014, 0x24}, {0xc002ffded0, 0xa}, {0xc002ffdeb4, 0xb}}, 0xc00366a580)
        github.com/hashicorp/terraform-provider-azurerm/internal/services/network/virtual_network_gateway_resource.go:935 +0x7bb
github.com/hashicorp/terraform-provider-azurerm/internal/services/network.resourceVirtualNetworkGatewayCreate(0xc00366a580, {0x71c0de0, 0xc001f18488})
        github.com/hashicorp/terraform-provider-azurerm/internal/services/network/virtual_network_gateway_resource.go:675 +0x3fc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x8a7d228?, {0x8a7d228?, 0xc00366cc30?}, 0xd?, {0x71c0de0?, 0xc001f18488?})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.35.0/helper/schema/resource.go:794 +0x15f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc00183b7a0, {0x8a7d228, 0xc00366cc30}, 0xc003676680, 0xc00366a400, {0x71c0de0, 0xc001f18488})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.35.0/helper/schema/resource.go:937 +0xa89
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00059ab88, {0x8a7d228?, 0xc00366cb70?}, 0xc003628af0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.35.0/helper/schema/grpc_provider.go:1155 +0xd5c
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ApplyResourceChange(0xc001bd2380, {0x8a7d228?, 0xc00366c8a0?}, 0xc003628af0)
        github.com/hashicorp/terraform-plugin-mux@v0.17.0/tf5muxserver/mux_server_ApplyResourceChange.go:36 +0x193
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc001942c80, {0x8a7d228?, 0xc00366c0c0?}, 0xc0006e6a10)
        github.com/hashicorp/terraform-plugin-go@v0.25.0/tfprotov5/tf5server/server.go:865 +0x3d0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x7f68080, 0xc001942c80}, {0x8a7d228, 0xc00366c0c0}, 0xc00366a100, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.25.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:611 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001b4e00, {0x8a7d228, 0xc00366c030}, {0x8aab440, 0xc001df6820}, 0xc0036679e0, 0xc00146b080, 0xe15a2b8, 0x0)
        google.golang.org/grpc@v1.67.1/server.go:1394 +0xe49
google.golang.org/grpc.(*Server).handleStream(0xc0001b4e00, {0x8aab440, 0xc001df6820}, 0xc0036679e0)
        google.golang.org/grpc@v1.67.1/server.go:1805 +0xe8b
google.golang.org/grpc.(*Server).serveStreams.func2.1()
        google.golang.org/grpc@v1.67.1/server.go:1029 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 52
        google.golang.org/grpc@v1.67.1/server.go:1040 +0x125

Error: The terraform-provider-azurerm_v4.11.0_x5 plugin crashed!

Expected Behaviour

Resource should deploy successfully.

Actual Behaviour

Fails with above error

Steps to Reproduce

No response

Important Factoids

Successfully deploys if the vpn_client_configuration block is removed

References

No response

@stephybun
Copy link
Member

Duplicate of #28097. Closed by #28099.

Copy link

github-actions bot commented Jan 2, 2025

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants