Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot migrate cloudflare_list_item from v4 to v5 #5135

Open
3 tasks done
cmbuckley opened this issue Feb 13, 2025 · 0 comments
Open
3 tasks done

Cannot migrate cloudflare_list_item from v4 to v5 #5135

cmbuckley opened this issue Feb 13, 2025 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. version/5 Categorizes issue or PR as related to version 5 of the provider.

Comments

@cmbuckley
Copy link

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.10.5
on linux_amd64
+ provider registry.terraform.io/cloudflare/cloudflare v5.1.0

Affected resource(s)

  • cloudflare_list_item

Terraform configuration files

resource "cloudflare_list" "test" {
  account_id  = "..."
  name        = "test"
  description = "Test list"
  kind        = "redirect"
}

resource "cloudflare_list_item" "test" {
  account_id = "..."
  list_id    = cloudflare_list.test.id

  redirect = {
    source_url         = "https://test.example.com/"
    target_url         = "https://example.com/"
    status_code        = 302
    include_subdomains = true
    subpath_matching   = true
  }
}

Link to debug output

https://gist.github.com/cmbuckley/a97149306b445c2e271d05a9d4dca86c

Panic output

No response

Expected output

Able to migrate cloudflare_list_item resource from v4 to v5, or use combination of terraform state rm / terraform import per the migration guide

Actual output

When doing a straight upgrade to v5:

Warning: Failed to decode resource from state
Error decoding "cloudflare_list_item.test" from prior state: missing expected {

Error: Resource instance managed by newer provider version
The current state of cloudflare_list_item.test was created by a newer provider version than is currently selected.
Upgrade the cloudflare provider to work with this state.

When attempting to remove and re-import the resource:

Error: Resource Import Not Implemented

Steps to reproduce

  1. Create a cloudlfare_list_item resource under v4.52.0 of the provider
  2. Upgrade to v5.1.0
  3. Run terraform apply
  4. Observe error above

Per other resources in the migration guide, the steps could look like

  1. Run terraform state rm cloudflare_list_item.test
  2. Upgrade to v5.1.0
  3. Run terraform import cloudflare_list_item.test ...

But cloudflare_list_item does not support import in v5 of the provider. Is this intentional?

Additional factoids

No response

References

No response

@cmbuckley cmbuckley added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 13, 2025
@jacobbednarz jacobbednarz added the version/5 Categorizes issue or PR as related to version 5 of the provider. label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. version/5 Categorizes issue or PR as related to version 5 of the provider.
Projects
None yet
Development

No branches or pull requests

2 participants