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

Importing an existing cloudflare_zone results in error #4999

Open
bcruikshank opened this issue Jan 31, 2025 · 0 comments
Open

Importing an existing cloudflare_zone results in error #4999

bcruikshank opened this issue Jan 31, 2025 · 0 comments

Comments

@bcruikshank
Copy link

I have an existing CloudFlare domain verified in the dashboard with NS records pointed to CF and looking to import into OpenTofu v1.8.8 state to manage this zone.

My CloudFlare provider version:
providers.tf:

    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = "5.0.0"
    }

main.tf:

resource "cloudflare_zone" "example" {
  account = {
    id = var.cloudflare_account_id
  }
  name = "example.com"
  type = "full"
}

When I do an import it appears successful:

# tofu import cloudflare_zone.example '01234567891234567890'
cloudflare_zone.example: Importing from ID "01234567891234567890"...
cloudflare_zone.example: Import prepared!
  Prepared cloudflare_zone for import
cloudflare_zone.example: Refreshing state... [id=01234567891234567890]

Import successful!

When I go to do a plan/apply

cloudflare_zone.example: Refreshing state... [id=01234567891234567890]

OpenTofu used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

OpenTofu will perform the following actions:

  # cloudflare_zone.example will be updated in-place
  ~ resource "cloudflare_zone" "example" {
      ~ activated_on          = "2025-01-15T02:23:43Z" -> (known after apply)
      ~ created_on            = "2025-01-15T02:14:12Z" -> (known after apply)
      ~ development_mode      = 0 -> (known after apply)
        id                    = "01234567891234567890"
      ~ meta                  = {
          + cdn_only                 = (known after apply)
          ~ custom_certificate_quota = 1 -> (known after apply)
          + dns_only                 = (known after apply)
          + foundation_dns           = (known after apply)
          ~ page_rule_quota          = 100 -> (known after apply)
          ~ phishing_detected        = false -> (known after apply)
          ~ step                     = 2 -> (known after apply)
        } -> (known after apply)
      ~ modified_on           = "2025-01-15T04:17:22Z" -> (known after apply)
        name                  = "example.com"
      ~ name_servers          = [
          - "gordon.ns.cloudflare.com",
          - "zainab.ns.cloudflare.com",
        ] -> (known after apply)
      + original_dnshost      = (known after apply)
      ~ original_name_servers = [
          - "ns-1.awsdns-33.org",
          - "ns-2.awsdns-15.net",
          - "ns-3.awsdns-21.co.uk",
          - "ns-4.awsdns-41.com",
        ] -> (known after apply)
      ~ original_registrar    = "amazon registrar, inc. (id: )" -> (known after apply)
      ~ owner                 = {
          ~ id   = "f1c1e2a9b986ba191ff0c9d2ab9e1f0" -> (known after apply)
          ~ name = "MyAccount" -> (known after apply)
          ~ type = "organization" -> (known after apply)
        } -> (known after apply)
      ~ status                = "active" -> (known after apply)
      - vanity_name_servers   = [] -> null
        # (3 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  OpenTofu will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

cloudflare_zone.example: Modifying... [id=01234567891234567890]
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to cloudflare_zone.example, provider "provider[\"registry.opentofu.org/cloudflare/cloudflare\"]" produced an unexpected new value:
│ .id: was cty.StringVal("01234567891234567890"), but now null.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to cloudflare_zone.example, provider "provider[\"registry.opentofu.org/cloudflare/cloudflare\"]" produced an unexpected new value:
│ .paused: was cty.False, but now null.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵

Any ideas why this might be failing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant