cloudflare / terraform-provider-cloudflare

Cloudflare Terraform Provider
https://registry.terraform.io/providers/cloudflare/cloudflare
Mozilla Public License 2.0
755 stars 579 forks source link

produced an unexpected new value: block count changed from 355 to 350. ā”‚ This is a bug in the provider, which should be reported in the provider's own issue tracker. #3758

Open VinothKumaranbalagan opened 2 weeks ago

VinothKumaranbalagan commented 2 weeks ago

Confirmation

Terraform and Cloudflare provider version

TF_VERSION: 1.7.3

Affected resource(s)

My plan was perfect when I try apply it shows an error but my changes are reflected. Still my apply throws error.

Terraform configuration files

rules {
    description = "CF Managed ruleset"
    action      = "execute"
    expression  = "true"
    enabled     = true
    action_parameters {
      id = "efb7b8c949ac4650a09736fc376e9aee"
      matched_data {
         public_key = "RNVswpeLJZUutHHUnCkXLIVY5X0B6H5z+q2KCheealk="
      }
      overrides {
        action = "log"
        enabled = "true"
        dynamic "rules" {
          for_each = { for rule in var.managed_ruleset_overrides : rule.rule_id => rule }
          content {
            id = rules.value.rule_id
            action = rules.value.action
            enabled = rules.value.status // All rules should be enabled
          }
        }

      }
    }
  }

Link to debug output

https://gist.github.com/VinothKumaranbalagan/0d22fdd736cbdd3602387d2c26c5bccc

Panic output

No response

Expected output

Apply all over rides with any error.

Actual output

module.waf_rulesets.cloudflare_ruleset.cf_managed_ruleset: Modifying... [id=5d726c2f5a08429fb8413485d5f44612] module.waf_rulesets.cloudflare_ruleset.cf_managed_ruleset: Still modifying... [id=5d726c2f5a08429fb8413485d5f44612, 10s elapsed]

Error: Provider produced inconsistent result after apply

When applying changes to module.waf_rulesets.cloudflare_ruleset.cf_managed_ruleset, provider "provider[\"registry.terraform.io/cloudflare/cloudflare\"]" produced an unexpected new value: .rules[2].action_parameters[0].overrides[0].rules: block count changed from 355 to 350.

This is a bug in the provider, which should be reported in the provider's own issue tracker.

Steps to reproduce

Try to create an override Rule for all the remaining rules in Managed Rulesets. Have all rule id in tfvars or in main try to run terraform apply.

Additional factoids

No response

References

No response

github-actions[bot] commented 2 weeks ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 2 weeks ago

Thank you for opening this issue and sorry to hear you're hitting issues. Unfortunately, the reproduction case provided contains HCL dynamic expressions. Examples of these are:

Maintainers don't accept these as reproduction cases since using these constructs and expressions can hold their own logic bugs which are outside of the provider and not able to be diagnosed.

For maintainers to triage this issue, we recommend providing a minimal reproduction test case that is only contains the impacted resources and can be easily reproduced in an isolated environment. Without providing this, maintainers are limited in what support they can provide.