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

Google Compute Forward Rule creation failure when ports list longer than five items #13823

Closed
owensk opened this issue Apr 20, 2017 · 3 comments · Fixed by #13952
Closed

Google Compute Forward Rule creation failure when ports list longer than five items #13823

owensk opened this issue Apr 20, 2017 · 3 comments · Fixed by #13952

Comments

@owensk
Copy link

owensk commented Apr 20, 2017

Terraform Version

Terraform v0.9.3

Affected Resource(s)

  • google_compute_forwarding_rule

Terraform Configuration Files

resource "google_compute_forwarding_rule" "linkerd-more-ports-forwarding-rule" {
  name                  = "linkerd-more-ports-forwarding-rule"
  backend_service       = "${google_compute_region_backend_service.linkerd-regional-backend-service.self_link}"
  ports                 = ["7002","7004","7007","7011","7019","7021","7029"]
  load_balancing_scheme = "INTERNAL"
}

Debug Output

Plan output:

+ module.linkerd-prod.google_compute_forwarding_rule.linkerd-more-ports-forwarding-rule
    backend_service:       "https://www.googleapis.com/compute/v1/projects/olark-main/regions/us-central1/backendServices/linkerd-regional-backend-service"
    ip_address:            "<computed>"
    ip_protocol:           "<computed>"
    load_balancing_scheme: "INTERNAL"
    name:                  "linkerd-more-ports-forwarding-rule"
    network:               "<computed>"
    ports.#:               "7"
    ports.2135072231:      "7002"
    ports.2518759634:      "7004"
    ports.254306664:       "7007"
    ports.3565006559:      "7021"
    ports.3668322029:      "7029"
    ports.4052448558:      "7019"
    ports.4283497756:      "7011"
    project:               "<computed>"
    region:                "<computed>"
    self_link:             "<computed>"
    subnetwork:            "<computed>"

Apply Ouput:

Error applying plan:

1 error(s) occurred:

* module.linkerd-prod.google_compute_forwarding_rule.linkerd-more-ports-forwarding-rule: 1 error(s) occurred:

* google_compute_forwarding_rule.linkerd-more-ports-forwarding-rule: Error creating ForwardingRule: googleapi: Error 400: Invalid value for field 'resource.ports[5]': '7019'. Too many ports specified. Maximum is 5., invalid

Expected Behavior

Should create forwarding rule that forwards listed ports to all instances in backend.

Actual Behavior

Doesn't create anything on apply. plan doesn't fail because too many ports listed.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Setup forwarding rule to look like config give
  2. terraform plan to see change
  3. terraform apply to attempt change

Important Factoids

Neither TerraForm or Google Cloud Compute Forwarding rules documentation specify an upper limit of 5 ports on an internal forwarding rule.

@danawillow
Copy link
Contributor

Hey @owensk, I see at https://cloud.google.com/compute/docs/reference/latest/forwardingRules that a maximum of 5 ports can be specified. Can you point me to where else within GCP you expected to see that documented? In the meantime, I can fix the terraform documentation and throw an error in the plan stage.

@owensk
Copy link
Author

owensk commented Apr 25, 2017

Apparently, I missed that location when I was looking around to solve this problem. I think updating TerraForm docs and throwing an error in plan are an acceptable solution.

@ghost
Copy link

ghost commented Apr 13, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants