Argument "bgp_settings" for azurerm_local_network_gateway

Hi Guys,

I’m trying to configure the bgp_settings argument within the Local Network gateway, I’ve already tried several parameters and none of them worked, see below the argument I’m using, I receive the error message below:

An argument named “bgp_settings” is not expected here. Did you mean to define a block of type “bgp_settings”?

Does anyone have any tips?

resource “azurerm_local_network_gateway” “tilid_claro” {
name = “LNG-${var.env}-X_CLARO”
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
gateway_address = “189.55.X.X”
address_space = [“172.200.200.0/24”, “172.200.210.0/24”]
bgp_settings = {
asn = 65200
peering_address = “10.200.200.4”
}

As per the docs azurerm_local_network_gateway and as indicated by the error, the bgp_settings is a block.

Therefore your code should look like this:

resource “azurerm_local_network_gateway” “tilid_claro” {
  name = “LNG-${var.env}-X_CLARO”
  resource_group_name = azurerm_resource_group.rg.name
  location = azurerm_resource_group.rg.location
  gateway_address = “189.55.X.X”
  address_space = [“172.200.200.0/24”, “172.200.210.0/24”]
  bgp_settings {
    asn = 65200
    peering_address = “10.200.200.4”
  }
}

Note that there is no = for a block

HTH

Happy Terraforming!

Hi HTH

That fine, nice!!! now its working :slight_smile:

Thank you so much for your help.

Great.
Eduardo!

1 Like