hashicorp/terraform-provider-azurerm

azurerm_virtual_network_gateway: bgp_settings

peterb154 opened this issue ยท 9 comments

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 "+1" or "me too" comments, 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

Terraform Version

$ terraform -v
Terraform v0.11.8

  • provider.azurerm v1.15.0

Affected Resource(s)

  • azurerm_virtual_network_gateway

Terraform Configuration Files

resource "azurerm_virtual_network_gateway" "rg-prod-ncus-network__vgw-prod-ncus-infrahub" {
   name = "vgw-prod-ncus-infrahub"
   resource_group_name = "rg-prod-ncus-network"
   location = "northcentralus"
   type = "ExpressRoute"
   vpn_type = "PolicyBased"
   sku = "Standard"
   active_active = "false"
   enable_bgp = "false"
  ip_configuration {
     name = "default"
     private_ip_address_allocation = "Dynamic"
     public_ip_address_id = "${azurerm_public_ip.rg-prod-ncus-network__pip-prod-ncus-vgw-infrahub.id}"
     subnet_id = "${azurerm_subnet.rg-prod-ncus-network__GatewaySubnet.id}"
  }
}

Debug Output

https://gist.github.com/6aa4cd02e3c93f92fe83354e96224081

Panic Output

N/A

Expected Behavior

With azurerm_virtual_network_gateway paramameter: enable_bgp = "false"
and no "bgp_settings" defined in .tf file, and bgp is not enabled in Azure, terraform plan should detect no changes required.

$ az network vnet-gateway list -g rg-prod-ncus-network | jq .[0].name
"vgw-prod-ncus-infrahub"

$ az network vnet-gateway list -g rg-prod-ncus-network | jq .[0].enableBgp
false

$ az network vnet-gateway list -g rg-prod-ncus-network | jq .[0].bgpSettings
null

Actual Behavior

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ azurerm_virtual_network_gateway.rg-prod-ncus-network__vgw-prod-ncus-infrahub
      bgp_settings.#: "" => <computed>


Plan: 0 to add, 1 to change, 0 to destroy.

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

Steps to Reproduce

  1. terraform plan

Important Factoids

References

There is a discussion about this issue on reddit

  • #0000

encounter the same issue. It probably due to Azure SDK behaviour that expect bgp setting even though expressRoute does not support BGP setting.

I've ran into this as well.
With the PowerShell AzureRM module is shows BGPSettings: null.

I don't send any bgp_settings in tf and it should bgp_settings => computed

Thanks for getting this working.

Thank you so much for the fix.

I'm still seeing bgp_settings.$: "" => <compute>
(I thought i ran a terraform plan earlier to test but I must have been in the wrong directory).

Do I need to update the terraform azurerm provider for these changes to come into affect?
Or will this be available in a future release?
(I ran terraform init but nothing new was pulled in)

provider "azurerm" {
  version         = "~> 1.4"

@midacts this hasn't been released yet - it'll be part of 1.19 when that release ships.

@midacts , @katbyte merged the code into the master branch, but they have not yet released a new version of the provider. The last release was 1.18.0 released 12 days ago.
https://github.com/terraform-providers/terraform-provider-azurerm/releases Historically, they have been releasing every 2 weeks or so. When they release version 1.19 it should be available in TF.

In the mean time, if you want to test the latest code in master branch, you could install it as a third party plugin https://www.terraform.io/docs/configuration/providers.html#third-party-plugins

Good to know about the release cycle.
I just ran a terraform init and saw 1.19 was available.

After downloading it I can confirm this is fixed.
(I'm starting to get the hang of terraform a little bit).

Thanks guys.

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error ๐Ÿค– ๐Ÿ™‰ , please reach out to my human friends ๐Ÿ‘‰ hashibot-feedback@hashicorp.com. Thanks!