Add ceritificateManagerCertificates field to ComputeRegionTargetHttpsProxy resource #7010
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a new field certificateManagerCertificates field to ComputeRegionTargetHttpsProxy resource.
This is exactly the same to what was done for ComputeTargetHttpsProxy GoogleCloudPlatform/magic-modules#9144
Context :
The resource ComputeRegionTargetHttpsProxy 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). It was agreed to handle this situation by defining a new field that shall be used when the customer wants to reference certificate manager certificates instead of sslCertificates.
More discussion about this here
What has been done in this PR:
CertificateManagerCerticates
in the resourcerequired=true
from sslCertificates fieldsslCertificates
toCertificateManagerCertificates
in TF in case the user used certificate manager certs instead of sslCerts (note that we can't have both sslCertificates and CertificateManagerCertificates defined together)//certificatemanager.googleapis.com/projects/{{project}}/..
. For a better and more convenient UX, an expander is defined so that the customer can use theid
of the resource (i.e.projects/{{project}}/...
) and the expander will take care of the conversion//certificatemanager.googleapis.com/projects/{{project}}/..
, that's why a diff_suppress_func is used.Fixes: hashicorp/terraform-provider-google#16998
b/320650971
Release Note Template for Downstream PRs (will be copied)
Derived from GoogleCloudPlatform/magic-modules#10011