diff --git a/.changelog/2192.txt b/.changelog/2192.txt new file mode 100644 index 0000000000..31b4dee0a2 --- /dev/null +++ b/.changelog/2192.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/cloudflare_page_rule: make cache_key_fields optional to align with API constraints +``` diff --git a/internal/sdkv2provider/schema_cloudflare_page_rule.go b/internal/sdkv2provider/schema_cloudflare_page_rule.go index 39ed75de91..80a8304f53 100644 --- a/internal/sdkv2provider/schema_cloudflare_page_rule.go +++ b/internal/sdkv2provider/schema_cloudflare_page_rule.go @@ -283,11 +283,12 @@ func resourceCloudflarePageRuleSchema() map[string]*schema.Schema { Type: schema.TypeList, Optional: true, MaxItems: 1, + MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "cookie": { Type: schema.TypeList, - Required: true, + Optional: true, MinItems: 1, MaxItems: 1, Elem: &schema.Resource{ @@ -314,7 +315,7 @@ func resourceCloudflarePageRuleSchema() map[string]*schema.Schema { "header": { Type: schema.TypeList, - Required: true, + Optional: true, MinItems: 1, MaxItems: 1, Elem: &schema.Resource{ @@ -349,7 +350,7 @@ func resourceCloudflarePageRuleSchema() map[string]*schema.Schema { "host": { Type: schema.TypeList, - Required: true, + Optional: true, MinItems: 1, MaxItems: 1, Elem: &schema.Resource{ @@ -365,7 +366,7 @@ func resourceCloudflarePageRuleSchema() map[string]*schema.Schema { "query_string": { Type: schema.TypeList, - Required: true, + Optional: true, MinItems: 1, MaxItems: 1, Elem: &schema.Resource{ @@ -397,7 +398,7 @@ func resourceCloudflarePageRuleSchema() map[string]*schema.Schema { "user": { Type: schema.TypeList, - Required: true, + Optional: true, MinItems: 1, MaxItems: 1, Elem: &schema.Resource{