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

There is no variable named "terraform". #36

Open
PrivoSkadberg opened this issue Oct 21, 2019 · 2 comments
Open

There is no variable named "terraform". #36

PrivoSkadberg opened this issue Oct 21, 2019 · 2 comments

Comments

@PrivoSkadberg
Copy link

I'm using workspaces and have some code like this:

resource "aws_route53_zone" "child_zone" {
  name    = "${terraform.workspace}.${var.parent_domain_name}."
  comment = "Managed by Terraform"
  tags = merge(
    local.tags,
    {
      "Name" = "${terraform.workspace}.${var.parent_domain_name}."
    },
  )
}

When I open it up in VS Code, I get this:

There is no variable named "terraform". The full error is:

{
	"resource": "/PathToMy/terraform.tf",
	"owner": "_generated_diagnostic_collection_name_#1",
	"severity": 8,
	"message": "There is no variable named \"terraform\".",
	"source": "Terraform Schema",
	"startLineNumber": 2,
	"startColumn": 41,
	"endLineNumber": 2,
	"endColumn": 50
}

Not 100% sure its an issue with the LSP, but I thought I would report it here since it looks like it may be related.

Thanks!
Ryan

@rbrtl
Copy link

rbrtl commented Jan 22, 2020

hashicorp/vscode-terraform#269 and the associated issues address the same concern specific to VSCode

@LevinDmytro2
Copy link

LevinDmytro2 commented Mar 29, 2020

I have a similar problem when there are links to resources in other .tf files

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

3 participants