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 #6460

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: hashicorp/terraform-provider-google#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 <[email protected]>
[upstream:dc950684e5f0ee1389008bce9ff157ff62fe789d]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician merged commit 5c8aeec into hashicorp:main Oct 9, 2023
@modular-magician modular-magician deleted the downstream-pr-dc950684e5f0ee1389008bce9ff157ff62fe789d branch November 16, 2024 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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