-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Updating a google_compute_ssl_certificate fails if it is used by a google_compute_target_https_proxy #10546
Comments
It looks like it's doing a delete/recreate on the SSL certificate resource rather than updating it in place. It doesn't look like an update method has been created for this resource at all. Relevant code: |
A workaround that could be worth trying is adding |
For some more information on this, re: @cblecker's comment: It looks like SSL certificates on GCE aren't able to be updated through the API; you can read, create, and delete, but not update. So the resource is (as far as I can tell) doing the right thing by not providing an update method; instead, a new resource needs to be created and the old one destroyed whenever there's a change. Because the SSL certificate is attached to the HTTPS proxy, GCP stops it from being deleted. So the new SSL certificate needs to be created, the HTTPS proxy needs to be updated to use the new certificate, and the old SSL certificate is then not being used, so it can be deleted. To do this in Terraform, we use Hopefully that makes sense! Feel free to reach out if there's any confusion. |
Hi @paddyforan -- You're right though, there is no update method for this resource at all, so |
According to my testing, |
@paddyforan -- |
You're awesome! 👍 Commented on it; docs and a simple test case are pretty much all that stands in the way of this getting merged. Feel free to tag off with me if you don't think you'll have time to hit that stuff today. :) |
Name prefixes will now be part of 0.8, which means the best recommendation I have is to:
That should resolve the issue. If not, please feel free to comment back here and we'll reopen the issue, or just open a new issue. Thanks for reporting! |
As reported in hashicorp/terraform#10546, google_compute_ssl_certificates that are attached to google_compute_target_https_proxies cannot be updated. This implements the suggested workaround of creating a new certificate before deleting the existing one, and using `name_prefix` instead of `name` so there's no name uniqueness constraints hit.
As reported in hashicorp/terraform#10546, google_compute_ssl_certificates that are attached to google_compute_target_https_proxies cannot be updated. This implements the suggested workaround of creating a new certificate before deleting the existing one, and using `name_prefix` instead of `name` so there's no name uniqueness constraints hit.
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. |
Terraform Version
v0.7.13
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/wendorf/c06658d04d8ce9011a559c1636fbad4e
Expected Behavior
Updating a google_compute_ssl_certificate that is attached to a google_compute_target_https_proxy should not fail.
Actual Behavior
Updating the private key and cert for a google_compute_ssl_certificate failed with "* google_compute_ssl_certificate.ssl_certificate: Error deleting ssl certificate: googleapi: Error 400: The ssl_certificate resource 'my-ssl-certificate' is already being used by 'my-target-https-proxy', resourceInUseByAnotherResource"
Steps to Reproduce
terraform apply
with an initial key/cert pairterraform apply
againThe text was updated successfully, but these errors were encountered: