Skip to content

Invalid Schema Error Attempting v5 Migration #6638

@drcapulet

Description

@drcapulet

Confirmation

  • This is a bug with an existing resource and is not a feature request or enhancement. Feature requests should be submitted with Cloudflare Support or your account team.
  • I have searched the issue tracker and my issue isn't already found.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform v1.14.3
on darwin_arm64
+ provider registry.terraform.io/cloudflare/cloudflare v5.15.0
+ provider registry.terraform.io/datadog/datadog v3.84.0
+ provider registry.terraform.io/hashicorp/google v6.50.0

Affected resource(s)

  • cloudflare_ruleset

Terraform configuration files

resource "cloudflare_ruleset" "my_custom_ruleset" {
  account_id = "my-account-id"
  kind       = "custom"
  name       = "my custom ruleset"
  phase      = "http_request_firewall_custom"

  rules = [
    {
      action      = "log"
      description = "log"
      enabled     = true
      expression  = "true"
      ref         = "my-ref"
    },
  ]
}

Link to debug output

N/A

Panic output

No response

Expected output

Successful Terraform plan

Actual output

│ Warning: Failed to decode resource from state
│
│ Error decoding "cloudflare_ruleset.my_custom_ruleset" from prior state: missing expected {
...
│ Error: Resource instance managed by newer provider version
│
│ The current state of cloudflare_ruleset.my_custom_ruleset was created by a newer provider version than is currently selected. Upgrade the cloudflare provider to
│ work with this state.

Steps to reproduce

  1. Start with a ruleset saved into state using provider v4.52.0
  2. Update the provider to v5.15.0
  3. terraform plan

Additional factoids

#6237 indicates this resource should be fixed already.

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions