-
Notifications
You must be signed in to change notification settings - Fork 626
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
make csr optional for origin ca #955
Conversation
In the past, the CSR was required as it was the only method of generating certificates. That isn't the case anymore and in some scenarios, we don't need to enforce the CSR as we may be importing. Instead of enforcing this at the schema level, we can make it optional and apply it within the `Create` should it be present. Fixes #950
…icate validity While fixing another issue in this resource, I noticed we were not setting the `requested_validity` however it is a schema attribute. As this value isn't present in the API, we need to manually calculate it using some time comparisons based on the certificate `ExpiresOn` value.
Using provider
I haven't tested the CSR portion yet, since I ran into this first. |
My HCL looks like this: resource "cloudflare_origin_ca_certificate" "example" {
csr = tls_cert_request.example.cert_request_pem
hostnames = [ "*.example.com", "example.com" ]
request_type = "origin-rsa"
} I tried changing it to this: resource "cloudflare_origin_ca_certificate" "example" {
csr = tls_cert_request.example.cert_request_pem
hostnames = [ "*.example.com", "example.com" ]
request_type = "origin-rsa"
requested_validity = 5471
} which resulted in this error:
And, of course, changing it to |
i can't see why we'd need |
Hi, since |
I've been seeing resources get recreated because of the request_validity change aswell Getting around it via:
for now. |
In the past, the CSR was required as it was the only method of generating
certificates. That isn't the case anymore and in some scenarios, we don't need
to enforce the CSR as we may be importing. Instead of enforcing this at the
schema level, we can make it optional and apply it within the
Create
shouldit be present.
Fixes #950
As a bonus I've also fixed a bug with the
requested_validity
not beingpersisted within the state which prevents storing unnecessary
null
values.