From 2e8e6948b7e35358fa7cbef71c344af5970e4c99 Mon Sep 17 00:00:00 2001 From: Fabio Peruzzo Barbosa Date: Thu, 24 Nov 2022 12:58:05 +0100 Subject: [PATCH 1/2] Add the ForceNew flag --- .changelog/2055.txt | 3 +++ internal/provider/schema_cloudflare_origin_ca_certificate.go | 1 + 2 files changed, 4 insertions(+) create mode 100644 .changelog/2055.txt diff --git a/.changelog/2055.txt b/.changelog/2055.txt new file mode 100644 index 0000000000..c8a37799b4 --- /dev/null +++ b/.changelog/2055.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/cloudflare_origin_ca_certificate: trigger a replacement when `csr` is changed +``` \ No newline at end of file diff --git a/internal/provider/schema_cloudflare_origin_ca_certificate.go b/internal/provider/schema_cloudflare_origin_ca_certificate.go index cc5ef40c38..5567459c65 100644 --- a/internal/provider/schema_cloudflare_origin_ca_certificate.go +++ b/internal/provider/schema_cloudflare_origin_ca_certificate.go @@ -13,6 +13,7 @@ func resourceCloudflareOriginCACertificateSchema() map[string]*schema.Schema { }, "csr": { Type: schema.TypeString, + ForceNew: true, Optional: true, ValidateFunc: validateCSR, }, From be3f890f898012bd728d0a2e9b1631ab6a655620 Mon Sep 17 00:00:00 2001 From: Fabio Peruzzo Barbosa Date: Thu, 24 Nov 2022 13:12:01 +0100 Subject: [PATCH 2/2] Removing superfluous UpdateContext --- internal/provider/resource_cloudflare_origin_ca_certificate.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/provider/resource_cloudflare_origin_ca_certificate.go b/internal/provider/resource_cloudflare_origin_ca_certificate.go index ffb172cc99..35a002c9c2 100644 --- a/internal/provider/resource_cloudflare_origin_ca_certificate.go +++ b/internal/provider/resource_cloudflare_origin_ca_certificate.go @@ -19,7 +19,6 @@ func resourceCloudflareOriginCACertificate() *schema.Resource { return &schema.Resource{ Schema: resourceCloudflareOriginCACertificateSchema(), CreateContext: resourceCloudflareOriginCACertificateCreate, - UpdateContext: resourceCloudflareOriginCACertificateCreate, ReadContext: resourceCloudflareOriginCACertificateRead, DeleteContext: resourceCloudflareOriginCACertificateDelete, Importer: &schema.ResourceImporter{