Problem with cloudflare_ruleset custom cache key with exclude_origin true - block count changed from 1 to 0 #2799
Labels
kind/bug
Categorizes issue or PR as related to a bug.
triage/needs-information
Indicates an issue needs more information in order to work on it.
Confirmation
Terraform and Cloudflare provider version
Terraform version: 1.5.0
Cloudflare provider version: 4.15.0
Affected resource(s)
cloudflare_ruleset
Terraform configuration files
Link to debug output
https://gist.github.com/laliconfigcat/a2f076249596a3d8e68427a8144be22b
Panic output
No response
Expected output
The cloudflare_ruleset should be created.
Actual output
When applying changes to module.test_cache_rules.cloudflare_ruleset.cache_rule, provider "provider["registry.terraform.io/cloudflare/cloudflare"]" produced an unexpected new value: .rules[0].action_parameters[0].cache_key[0].custom_key[0].header: block count changed from 1 to 0.
This is a bug in the provider, which should be reported in the provider's own issue tracker.
Steps to reproduce
Additional factoids
I'd like to add a cache rule where the header exclude_origin is set to true, but I don't want to include anything or add anything to the check_presence arrays.
I checked the code and it seems that the exclude_origin header can only be set if I add anything to the include or check_presence arrays. If the include and check_presence lists are empty, the provider ignores the whole header block:
https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/internal/framework/service/rulesets/resource.go#L530
Am I doing something wrong? How could I set exclude_origin from the header without adding something to the include and check_presence arrays?
References
No response
The text was updated successfully, but these errors were encountered: