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

router_peer advertised_route_priority not applied if set to "0" #10246

Closed
Assignees
Labels

Comments

@rm-paoloventriglia
Copy link

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.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v1.0.1
on darwin_amd64
+ provider registry.terraform.io/hashicorp/google v3.76.0
+ provider registry.terraform.io/hashicorp/google-beta v3.76.0
+ provider registry.terraform.io/hashicorp/null v3.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.0

Affected Resource(s)

  • google_compute_router_peer

Terraform Configuration Files

module "cloud_router_london" {
  count   = var.cloud_router_london ? 1 : 0
  source  = "terraform-google-modules/cloud-router/google"
  version = "~> 1.1.0"

  name    = "${module.shared_vpc.network_name}-router-london"
  region  = "europe-west2"
  project = module.network_project.project_id
  network = module.shared_vpc.network_name
  bgp = {
    asn                  = var.asn
    advertised_ip_ranges = local.custom_ranges
  }
}

resource "google_compute_router_interface" "interface_dedicated_zone1" {
  count                   = var.carrier_enabled ? 1 : 0
  region                  = "europe-west2"
  project                 = module.network_project.project_id
  name                    = "bgp-if-zone1-${module.cloud_router_london[0].router.name}"
  router                  = module.cloud_router_london[0].router.name
  ip_range                = google_compute_interconnect_attachment.dedicated_zone1[0].cloud_router_ip_address
  interconnect_attachment = google_compute_interconnect_attachment.dedicated_zone1[0].id
}

resource "google_compute_router_peer" "bgp_dedicated_zone1" {
  count                     = var.carrier_enabled ? 1 : 0
  interface                 = google_compute_router_interface.interface_dedicated_zone1[0].name
  region                    = "europe-west2"
  project                   = module.network_project.project_id
  name                      = "bgp-peer-zone1-${module.cloud_router_london[0].router.name}"
  peer_asn                  = var.peer_asn
  peer_ip_address           = trimsuffix(google_compute_interconnect_attachment.dedicated_zone1[0].customer_router_ip_address, "/29")
  router                    = module.cloud_router_london[0].router.name
  advertised_route_priority = 0
}

resource "google_compute_interconnect_attachment" "dedicated_zone1" {
  count         = var.carrier_enabled ? 1 : 0
  name          = "ic-zone1-${module.cloud_router_london[0].router.name}"
  project       = module.network_project.project_id
  router        = module.cloud_router_london[0].router.name
  region        = "europe-west2"
  type          = "DEDICATED"
  vlan_tag8021q = 1100
  interconnect  = "https://www.googleapis.com/compute/v1/projects/vpc/global/interconnects/dedicated_ic_name"
  mtu           = var.mtu
}

Debug Output

2021-10-05T11:57:51.241+0100 [WARN]  Provider "provider[\"registry.terraform.io/hashicorp/google\"]" produced an unexpected new value for google_compute_router_peer.bgp_dedicated_zone1[0], but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .advertised_route_priority: was cty.NumberIntVal(0), but now cty.NumberIntVal(20)
google_compute_router_peer.bgp_dedicated_zone1[0]: Modifications complete after 2s.........

Panic Output

Expected Behavior

advertised_route_priority is set to 20 as per gcloud router output

"bgpPeers": [
    {
      "advertiseMode": "DEFAULT",
      "advertisedRoutePriority": 20,

terraform plan wants to change to 0 as per TF code

resource "google_compute_router_peer" "bgp_dedicated_zone1" {
      ~ advertised_route_priority = 20 -> 0

Actual Behavior

Nothing happens, terraform apply seems to modify the priority but nothing actually happens

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@nat-henderson
Copy link
Contributor

This looks like it requires the send_if_empty rule applied to it. I'll add that and add a test and see if that helps.

@github-actions
Copy link

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 Nov 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.