-
Notifications
You must be signed in to change notification settings - Fork 609
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
Incorrect hosts
attribute type for cloudflare_certificate_pack
#3287
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Terraform debug log detected ✅ |
Terraform debug log detected ✅ |
So, the provided log file is a dummy one, since the issue does not need diagnosis, any logs would be irrelevant. |
Looks like it was made to be a Set due to an issue with changing host order in API when the cert goes from Pending to Active: #799 |
That explains a lot. I am not very familiar with the provider implementation (or the framework/interfaces used for implementing the providers), but is it possible to have the type as a string array, but still ignore the ordering when comparing the content of the state to the API response? |
Confirmation
Terraform and Cloudflare provider version
Terraform v1.8.2
(Although it has nothing to do with the issue)
Affected resource(s)
cloudflare_certificate_pack
Terraform configuration files
Link to debug output
https://gist.github.com/tothdavid/d8e276439e7520f42b2ca41a615b2361
Panic output
No response
Expected output
In the created certificate pack the order of hostnames should be retained. This can be checked on cloudflare' API:
https://api.cloudflare.com/client/v4/zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id} (https://developers.cloudflare.com/api/operations/certificate-packs-get-certificate-pack)
Actual output
The order of hostnames in the created certificate pack is not defined.
Steps to reproduce
See "Additional factoids"
Additional factoids
The type of the
hosts
attribute for thecloudflare_certificate_pack
resource is wrong:On the Cloudflare's API it is defined as an
array[strings]
(see: https://developers.cloudflare.com/api/operations/certificate-packs-order-advanced-certificate-manager-certificate-pack#request-body), on the other hand this resource defines it asset(string)
(see: https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/certificate_pack#hosts )This will make the order of the hostnames passed to the Cloudflare's API undefined, so the user has no control over that. This is however important, because Cloudflare will use the first entry for the CN of the certificate.
Currently the only workaround is to create the Advanced certificate pack manually, although the UI will also sort the hostnames in a certain order after the pack is created, but for creating the certificate the order of the provided hostnames are respected.
References
No response
The text was updated successfully, but these errors were encountered: