Skip to content

False validation on cloudflare_pages_domain rejects "domain" and requires "name" #2214

Description

@mustanggb

Extension Version

v2.39.0

VS Code Version

Version: 1.111.0 (user setup)
Commit: ce099c1ed25d9eb3076c11e4a280f3eb52b4fbeb
Date: 2026-03-06T23:06:10Z
Electron: 39.6.0
ElectronBuildId: 13330601
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

Operating System

Ubuntu 22.04.5 LTS

Terraform Version

Terraform v1.14.5 on linux_arm64

Steps to Reproduce

  1. Have Cloudflare provider ~> 4.0 pinned in versions.tf
  2. Run terraform init (installs v4.52.5)
  3. Add a cloudflare_pages_domain resource using the domain attribute as documented in the installed provider schema:
    resource "cloudflare_pages_domain" "domain" {
      for_each = toset(var.site.domains)
    
      account_id   = var.cloudflare_account_id
      project_name = var.site.project_name
      domain       = each.value
    }
  4. Open the file in VS Code — the extension immediately shows:
    • Required attribute "name" not specified
    • Unexpected attribute: An attribute named "domain" is not expected here
  5. Run terraform plan — succeeds with no errors
  6. Confirm with terraform providers schema -json | python3 -c "import json,sys; s=json.load(sys.stdin); print(list(s['provider_schemas']['registry.terraform.io/cloudflare/cloudflare']['resource_schemas']['cloudflare_pages_domain']['block']['attributes'].keys()))" — outputs ['account_id', 'domain', 'id', 'project_name', 'status']

Expected Behavior

No errors should be shown. The domain attribute is valid for cloudflare_pages_domain in the installed provider version (v4.52.5), as confirmed by both terraform providers schema -json and a successful terraform plan.

Actual Behavior

The extension shows two errors on the cloudflare_pages_domain resource block: Required attribute "name" not specified and Unexpected attribute: An attribute named "domain" is not expected here. The errors persist after reloading the window. terraform plan succeeds without errors.

Terraform Configuration

terraform {
  required_providers {
    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = "~> 4.0"
    }
  }
}

resource "cloudflare_pages_domain" "domain" {
  for_each = toset(var.site.domains)

  account_id   = var.cloudflare_account_id
  project_name = var.site.project_name
  domain       = each.value
}

Project Structure

.
├── versions.tf
└── modules/
    └── frontend-site/
        ├── main.tf
        ├── variables.tf
        └── versions.tf

Gist

No response

Anything Else?

No other Terraform extensions installed.

Workarounds

None found. Reloading the window does not resolve the issue.

References

None found. The Cloudflare provider docs at https://registry.terraform.io/providers/cloudflare/cloudflare/4.52.5/docs/resources/pages_domain confirm domain as the correct attribute, consistent with what terraform providers schema -json reports locally.

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions