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

Add ceritificateManagerCertificates field to ComputeTargetHttpsProxy resource #16179

Conversation

modular-magician
Copy link
Collaborator

Add new field certificateManagerCertificates in the resource compute_target_https_proxy.

Context:
The resource ComputeTargetHttpsProxy has a field called sslCertificates, this field used to reference only ssl certificates. Recently, certificates of type CertificateManagerCertificates has been allowed. However, either all the items of the sslCertificates array will be sslCertificates or certificate manager certificates.

Furthermore, the field in TF couldn't accept certificate manager certificates because of a custom_expand function that only validates compute certificates (sslcertificates). A solution by @DanielRieske (GoogleCloudPlatform/magic-modules#8941) that should enable using the field with both types of certificates.

The solution suggested here is to use a new field certificate_manager_certificates, that should be used with the customer wants to reference a certificate manager certificate resources. Since this field doesn't exist in the API, I used encoder/decoder to change the the API request/response as needed.

[+] This is consistent with gcloud behaviour, as the customer enters the certificate manager certificates in a new field.
[+] Since it's not allowed to use mixed type of certificates in the array, it might make more sense to use different fields that are mutual exclusive.
[-] Adding a new field isn't consistent with the API definition of computeTargetHttpsProxy

We will confirm with compute team which solution is desired.

Fixes: #15805

Release Note Template for Downstream PRs (will be copied)

Add new field `certificateManagerCertificates` in the resource `ComputeTargetHttpsProxy`

Derived from GoogleCloudPlatform/magic-modules#9144

…resource (hashicorp#9144)

* Add ceritificateManagerCertificates field and handle the creation process using encoder and decoder

* Add custom_expand function that constructs the full URL if the provided input was relative self_link

* update the documetation of certificateManagerCertificates field

* Update the example

* Fix inconsistent spaces in the resource example

* Remove unnecessary ruby template in the custom_expand function

---------

Co-authored-by: Hamza Hassan <hamzahassan@google.com>
[upstream:dc950684e5f0ee1389008bce9ff157ff62fe789d]

Signed-off-by: Modular Magician <magic-modules@google.com>
@modular-magician modular-magician merged commit 385d188 into hashicorp:main Oct 9, 2023
3 checks passed
Copy link

github-actions bot commented Nov 9, 2023

I'm going to lock this pull request 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 related to this change, 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 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cross-regional Internal HTTPS Load Balancer Certificate Manager Compatibility doesn't work with proxy resource
1 participant