hashicorp / vscode-terraform

HashiCorp Terraform VSCode extension
https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform
Mozilla Public License 2.0
928 stars 180 forks source link

cloudflare_rulesets says the "filter" block is invalid #1869

Closed scott-doyland-burrows closed 1 week ago

scott-doyland-burrows commented 4 weeks ago

Extension Version

v2.33.0

VS Code Version

Version: 1.94.0 (user setup) Commit: d78a74bcdfad14d5d3b1b782f87255d802b57511 Date: 2024-10-02T13:08:12.626Z Electron: 30.5.1 ElectronBuildId: 10262041 Chromium: 124.0.6367.243 Node.js: 20.16.0 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.19045

Operating System

Windows WSL

Terraform Version

Terraform v1.9.8 on linux_amd64

Steps to Reproduce

Create a terraform .tf file with the contents as shown below.

Expected Behavior

Terraform code is correct, there should be no errors shown in the .tf file.

This used to work fine, so something in the extension has caused it to show as an error.

Actual Behavior

image

Terraform Configuration

data "cloudflare_rulesets" "managed_ruleset" {
  zone_id = data.cloudflare_zone.zone.zone_id

  filter {
    name = "Cloudflare Managed Ruleset"
  }
}

Project Structure

terraform/data.tf
terraform/variables.tf
terraform/my.tfvars

Gist

No response

Anything Else?

N/A

Workarounds

N/A

References

https://registry.terraform.io/providers/cloudflare/cloudflare/4.44.0/docs/data-sources/rulesets

Help Wanted

Community Note

dbanck commented 4 weeks ago

Hi @scott-doyland-burrows,

Thanks for reporting this!

It looks like the language server shipped with the alpha version (5.0.0-alpha1) of the Cloudflare provider schema instead of using the latest stable version (4.44.0). This may be a bug in our build pipeline, as Terraform normally defaults to using the stable release of a provider.

I'll look into it.

gaima8 commented 2 weeks ago

You're probably already aware, based on the comment about the language server build pipeline, but, v2.32.3 does not suffer with this problem. Both the current release (v2.33.0) and current pre-release (v2.34.2024101517) versions have the alpha version of Cloudflares schema, so complain about illegal syntax.