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

Changes in the validity of a origin_ca_certificate is not triggering a replacement of the resource #2045

Closed
2 tasks done
peruzzof opened this issue Nov 21, 2022 · 3 comments · Fixed by #2046
Closed
2 tasks done
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.
Milestone

Comments

@peruzzof
Copy link
Contributor

peruzzof commented Nov 21, 2022

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 and Cloudflare provider version

Terraform v1.3.5
on linux_amd64

  • provider registry.terraform.io/cloudflare/cloudflare v3.28.0

Affected resource(s)

cloudflare_origin_ca_certificate

Terraform configuration files

resource "cloudflare_origin_ca_certificate" "example" {
   csr                = tls_cert_request.example.cert_request_pem
  hostnames          = "redacted.domain.tld"
  request_type       = "origin-rsa"
  requested_validity = 90
}

Link to debug output

https://gist.github.com/peruzzof/2e7e49185f6f4f05e0d3c72d6d6bb461

Panic output

No response

Expected output

cloudflare_origin_ca_certificate.origin-certificate must be replaced

+/- resource "cloudflare_origin_ca_certificate" "origin-certificate" {
~ id = 710620734040230398620075686393988983954432376974-> (known after apply)
~ creation_timestamp = "2022-11-21T10:38:37.693-08:00" -> (known after apply)
~ requested_validity = 365 -> 90
# (3 unchanged attributes hidden)
}

Actual output

cloudflare_origin_ca_certificate.origin-certificate will be updated in-place

~ resource "cloudflare_origin_ca_certificate" "origin-certificate" {
id = "710620734040230398620075686393988983954432376974"
~ requested_validity = 365 -> 90
# (5 unchanged attributes hidden)
}

Steps to reproduce

  1. Create a origin_ca_certificate with any validity
  2. Change the validiy
  3. Execute a plan

Additional factoids

Doing some research I believe that this will be fixed adding the modifier "ForceNew: True" for the field validity in the file https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/internal/provider/schema_cloudflare_origin_ca_certificate.go

References

This may be related to #1007

@peruzzof peruzzof added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 21, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 21, 2022

Terraform debug log detected ✅

@github-actions github-actions bot added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 21, 2022
@peruzzof
Copy link
Contributor Author

@github-actions github-actions bot added triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. and removed triage/needs-information Indicates an issue needs more information in order to work on it. labels Nov 22, 2022
@peruzzof peruzzof changed the title Changes in the validity of a origin_ca_certificcate is not triggering a replacement of the resource Changes in the validity of a origin_ca_certificate is not triggering a replacement of the resource Nov 22, 2022
@github-actions github-actions bot added this to the v3.29.0 milestone Nov 23, 2022
@github-actions
Copy link
Contributor

This functionality has been released in v3.29.0 of the Terraform Cloudflare Provider.

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.
Projects
None yet
1 participant