Skip to content

False positive validation error in .tfvars with complex object structures #2064

@steveoh

Description

@steveoh

Extension Version

v2.34.5

VS Code Version

Version: 1.101.2
Commit: 2901c5ac6db8a986a5666c3af51ff804d05af0d4
Date: 2025-06-24T20:27:15.391Z
Electron: 35.5.1
ElectronBuildId: 11727614
Chromium: 134.0.6998.205
Node.js: 22.15.1
V8: 13.4.114.21-electron.0
OS: Darwin arm64 24.5.0

Operating System

macOS

Terraform Version

Terraform v1.12.2 on darwin_arm64 + provider registry.terraform.io/integrations/github v6.6.0

Steps to Reproduce

  1. Create a variables.tf with a complex object variable definition
  2. Create a terraform.tfvars file with values for that variable
  3. Notice red squiggly lines in the .tfvars file
  4. Run terraform validate - it passes successfully

Expected Behavior

No validation errors should be shown when the Terraform configuration is valid.

Actual Behavior

Unexpected attribute is not expected here

Red squiggly lines appear on valid .tfvars content.

Terraform Configuration

variable "standard_releases" {
  description = "A list of GitHub repositories that use our standard release process"
  type = set(object({
    name                   = string
    description            = string
    url                    = optional(string, "")
    topics                 = optional(list(string), [])
    primary_language       = string
    required_checks        = optional(set(string), [])
    is_template_repository = optional(bool, false)
    private                = optional(bool, false)
    template_repository    = optional(string, "")
    needs_wiki             = optional(bool, false)
    needs_pages            = optional(bool, false)
    needs_projects         = optional(bool, false)
    staff_permission       = optional(string, "pull")
    maintainers            = optional(list(string), [])
    collaborators          = optional(list(string), [])
    triagers               = optional(list(string), [])
    team_triage            = optional(list(string), [])
  }))
  default = []
}

Project Structure

Gist

No response

Anything Else?

No response

Workarounds

No response

References

No response

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

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