-
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
cloudflare_origin_ca_certificate diff lead to new certificate creation #1031
Comments
@azhurbilo what version of the Cloudflare provider are you using? |
sorry for the incorrect step (2), I will change it we used to https://github.com/cloudflare/terraform-provider-cloudflare/releases/tag/v2.7.0 and upgrade to https://github.com/cloudflare/terraform-provider-cloudflare/releases/tag/v2.20.0 |
Confirmed on provider v2.20.0. |
Is the issue here that it's not possible to simply keep (not "update in-place") the already-generated origin certificate, due to the requested validity being different from the remaining validity? I'm currently using this to avoid updating:
Possibly relevant: https://www.reddit.com/r/Terraform/comments/gi7yw7/recreate_resource_based_on_days_remaining/ |
This is an optional field and not required for anything other than new resources so it's fine to suppress all diffs for the field. Closes #1031
a PR is up for essentially ignoring this field after creation at # #1078 but still allowing it to be computed. i'd recommend you check it, build the provider locally and confirm it meets your expectations before it is merged. |
I can confirm that the update in-place message does not appear with the #1078 branch. Thanks. |
Instead of trying and failing to calculate the requested validity of the certificate we can use the returned validity. It looks like `requested_validity` was being used in 2 ways. The first one was to request the certificate for a time period and the second to indicate the amount of day the certificate is still valid. The calculation is no longer done and could be seen as a BC break but since the current setup is causing issue like cloudflare#1148, cloudflare#1276 and cloudflare#1031. I expect that this is acceptable. Related API docs: https://api.cloudflare.com/#origin-ca-get-certificate
Instead of trying and failing to calculate the requested validity of the certificate we can use the returned validity. It looks like `requested_validity` was being used in 2 ways. The first one was to request the certificate for a time period and the second to indicate the amount of day the certificate is still valid. The calculation is no longer done and could be seen as a BC break but since the current setup is causing issue like cloudflare#1148, cloudflare#1276 and cloudflare#1031. I expect that this is acceptable. Related API docs: https://api.cloudflare.com/#origin-ca-get-certificate
Instead of trying and failing to calculate the requested validity of the certificate we can use the returned validity. It looks like `requested_validity` was being used in 2 ways. The first one was to request the certificate for a time period and the second to indicate the amount of day the certificate is still valid. The calculation is no longer done and could be seen as a BC break but since the current setup is causing issue like cloudflare#1148, cloudflare#1276 and cloudflare#1031. I expect that this is acceptable. Related API docs: https://api.cloudflare.com/#origin-ca-get-certificate
Instead of trying and failing to calculate the requested validity of the certificate we can use the returned validity. It looks like `requested_validity` was being used in 2 ways. The first one was to request the certificate for a time period and the second to indicate the amount of day the certificate is still valid. The calculation is no longer done and could be seen as a BC break but since the current setup is causing issue like cloudflare#1448, cloudflare#1276 and cloudflare#1031. I expect that this is acceptable. Related API docs: https://api.cloudflare.com/#origin-ca-get-certificate
Confirmation
My issue isn't already found on the issue tracker.
I have replicated my issue using the latest version of the provider and it is still present.
Terraform version
Terraform v0.12.24
Affected resource(s)
cloudflare_origin_ca_certificate
Terraform configuration files
Debug output
No response
Panic output
No response
Expected output
Maybe it's possible to show that new "cloudflare_origin_ca_certificate" resource will be created
Actual output
3 step diff, but as result new certificate was generated
and next terraform run we got new diff related to other resources
4 step diff >>
Steps to reproduce
Additional factoids
As I understand (3 step) diff appears because of @jacobbednarz fix #955
as workaround we add
but in theory the same situation could happen with other fields too as it's not possible to modify cloudflare certificate (only revoke or create new one)
References
No response
The text was updated successfully, but these errors were encountered: