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

azurerm_vpn_gateway - Unsupported argument "bgp_settings" #21765

Closed ferserrano-contino closed 1 year ago

ferserrano-contino commented 1 year ago

Is there an existing issue for this?

Community Note

Terraform Version

1.4.6

AzureRM Provider Version

3.55.0

Affected Resource(s)/Data Source(s)

azurerm_vpn_gateway

Terraform Configuration Files

resource "azurerm_virtual_wan" "example" {
  name                = "example-vwan"
  resource_group_name = "testrg"
  location            = "westeurope"
}

resource "azurerm_virtual_hub" "example" {
  name                = "example-hub"
  resource_group_name = "testrg"
  location            = "westeurope"
  virtual_wan_id      = azurerm_virtual_wan.example.id
  address_prefix      = "10.0.1.0/24"
}

resource "azurerm_vpn_gateway" "vpn_gw" {
  name                                  = "example-vpn"
  resource_group_name                   = "testrg"
  location                              = "westeurope"
  virtual_hub_id                        = azurerm_virtual_hub.example.id
  bgp_route_translation_for_nat_enabled = true
  scale_unit                            = "2"

  bgp_settings = {
    asn         = "64512"
    peer_weight = "50"
    }
}

Debug Output/Panic Output

│ Error: Unsupported argument
│ 
│   on vpngateway.tf line 30, in resource "azurerm_vpn_gateway" "vpn_gw":
│   30:   bgp_settings = {
│ 
│ An argument named "bgp_settings" is not expected here. Did you mean to define a block of type "bgp_settings"?

Expected Behaviour

Complete terraform plan successfully

Actual Behaviour

terraform plan failed with the "Unsupported argument" error

Steps to Reproduce

Just a simple terraform plan to validate the creation of the resources listed on configuration files section

Important Factoids

No

References

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/vpn_gateway#bgp_settings

neil-yechenwei commented 1 year ago

Thanks for raising this issue. Seems the tf config you provided is incorrect. Please try below tf config. Thanks.

resource "azurerm_vpn_gateway" "test" {
  ......

  bgp_settings {
    asn         = 65515
    peer_weight = 0
  }
}
ferserrano-contino commented 1 year ago

Good spot. Apologies for my mistake and thanks replying it.

github-actions[bot] commented 3 months 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.