Skip to content

google_compute_target_ssl_proxy should support multiple ssl_certificates #8473

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

Assignees
Milestone

Comments

@quentinms
Copy link

quentinms commented Feb 16, 2021

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: v0.12.18
Google: 3.56.0

Affected Resource(s)

  • google_compute_target_ssl_proxy

Terraform Configuration Files

resource "google_compute_target_ssl_proxy" "default" {
  name             = "test-proxy"
  backend_service  = google_compute_backend_service.default.id
  ssl_certificates = [google_compute_managed_ssl_certificate.cert1.id, google_compute_managed_ssl_certificate.cert2.id]
}

resource "google_compute_managed_ssl_certificate" "cert1" {
  name    = "cert1"
  managed {
    domains = ["cert1.example.cm"]
  }
}

resource "google_compute_managed_ssl_certificate" "cert2" {
  name    = "cert2"
  managed {
    domains = ["cert2.example.cm"]
  }
}

resource "google_compute_backend_service" "default" {
  name          = "backend-service"
  protocol      = "SSL"
  health_checks = [google_compute_health_check.default.id]
}

resource "google_compute_health_check" "default" {
  name               = "health-check"
  check_interval_sec = 1
  timeout_sec        = 1
  tcp_health_check {
    port = "443"
  }
}

Debug Output

ssl_certificates = var.ssl_certificates
Attribute supports 1 item maximum, config has 2 declare

Panic Output

Expected Behavior

Terraform should create the SSL Proxy with both certificates (it's doable in the GCE UI).

It's important as it allows migration from a cert to another, as reflected in these docs: https://cloud.google.com/load-balancing/docs/ssl-certificates/google-managed-certs#migrating-ssl

Associate new Google-managed certificate with the correct target proxy while maintaining the target proxy's association with the existing self-managed certificate

Actual Behavior

Terraform complains that ssl_certificates can have only one value.
(which is reflected in the docs https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_target_ssl_proxy#ssl_certificates)

Steps to Reproduce

  1. terraform plan

Important Factoids

References

@ghost ghost added bug labels Feb 16, 2021
@edwardmedia edwardmedia self-assigned this Feb 16, 2021
@edwardmedia
Copy link
Contributor

edwardmedia commented Feb 16, 2021

Change label to enhancement

The code is currently set MaxItems: 1. We can increase it to match the max api allowed.

From api doc

URLs to SslCertificate resources that are used to authenticate connections to Backends. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates.

@quentinms
Copy link
Author

Thanks for the quick turnaround!

@ghost
Copy link

ghost commented Mar 20, 2021

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 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 20, 2021
@github-actions github-actions bot added forward/review In review; remove label to forward service/compute-l7-load-balancer labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.