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

resource/cloudflare_origin_ca: ignore decreasing requested_validity #1078

Merged

Conversation

jacobbednarz
Copy link
Member

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

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
@jacobbednarz jacobbednarz merged commit 95e2c07 into master Jun 1, 2021
@jacobbednarz jacobbednarz deleted the suppress-decreasing-time-remaining-for-origin-ca branch June 1, 2021 22:33
jacobbednarz added a commit that referenced this pull request Sep 22, 2021
…changes

In #1078 we shipped a change that would ignore the `requested_validity`
attribute as it is an ever decreasing value that shouldn't trigger a
change. However, digging into this has surfaced a bug in
`terraform-plugin-sdk`[1] that is preventing the schema from providing
the value to the CRUD method due to the presence of `DiffSuppressFunc`.
Instead of using a `DiffSuppressFunc`, mark the attribute as Optional
and Computed to allow it to be ignored when it decreases.

```
=== RUN   TestAccCloudflareOriginCACertificate_Basic
    resource_cloudflare_origin_ca_certificate_test.go:34: Step 1/2 error: Check failed: Check 6/6 error: cloudflare_origin_ca_certificate.mjrtkutxmm: Attribute 'requested_validity' expected "7", got "5475"
```

Closes #1160

[1]: hashicorp/terraform-plugin-sdk#806
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.

cloudflare_origin_ca_certificate diff lead to new certificate creation
1 participant