Skip to content

match not actually optional on google_compute_router_route_policy #23061

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

Open
tgoodsell-tempus opened this issue May 28, 2025 · 1 comment
Open
Labels
bug forward/review In review; remove label to forward service/compute-router

Comments

@tgoodsell-tempus
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 a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version & Provider Version(s)

Terraform v1.5.7
on linux/amd64

  • provider registry.terraform.io/hashicorp/google v6.37.0
  • provider registry.terraform.io/hashicorp/google-beta v6.37.0

Affected Resource(s)

google_compute_router_route_policy

Terraform Configuration

resource "google_compute_router_route_policy" "rp-export" {
  router = google_compute_router.router.name
  region = google_compute_router.router.region
    name = "my-rp1"
    type = "ROUTE_POLICY_TYPE_EXPORT"
    terms {
    priority = 1
    actions {
      expression = "accept()"
    }
  }
}

Debug Output

Error: Error creating RouterRoutePolicy: googleapi: Error 400: Required field 'resource.terms[0].match' not specified, required

Expected Behavior

Created the policy successfully, with the match applying to all resources.

Actual Behavior

Failed to create due to a lack of match attribute.

Steps to reproduce

  1. Setup route policy with similar configuration
  2. terraform apply

Important Factoids

https://cloud.google.com/compute/docs/reference/rest/v1/routers/updateRoutePolicy affirms the provider documentation this is supposed to be a supported mode of creating a policy.

Therefore, I suspect this is actually a "drift" or miscommunication by the team in charge of this API/product.

References

https://cloud.google.com/network-connectivity/docs/router/concepts/bgp-route-policies-overview

These docs don't give a clear indication of what I should expect on the match block.

@github-actions github-actions bot added forward/review In review; remove label to forward service/compute-router labels May 28, 2025
@tgoodsell-tempus
Copy link
Author

More specific error from the logs

status: {
code: 3
message: "com.google.apps.framework.request.StatusException: <eye3 title='INVALID_ARGUMENT'/> generic::INVALID_ARGUMENT: Required field 'resource.terms[0].match' not specified"
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug forward/review In review; remove label to forward service/compute-router
Projects
None yet
Development

No branches or pull requests

1 participant