question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unknown token: IDENT string

See original GitHub issue

I am using vscode-terraform 1.3.11 with this Terraform configuration:

variable "prefix" {
  type = string
}

That is producing this error in the PROBLEMS tab:

Unknown token: 2:10 IDENT string [2,10]

As far as I can tell from the Terraform Documentation, this should be valid.

If I run the same code through terraform validate and tflint, I get no reported errors:

$ terraform validate
Success! The configuration is valid.

$ tflint
Awesome! Your code is following the best practices :)

$ terraform --version
Terraform v0.12.0
+ provider.aws v2.12.0

$ tflint --version
TFLint version 0.8.0

I have both terraform.lintPath and terraform.path set to point to the correct versions of terraform and tflint.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:17
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

68reactions
Itihocommented, Aug 27, 2019

This bug still happens in version 1.4.0 with lsp server

14reactions
kevanlucccommented, Feb 18, 2020

Having this issue as well, code runs but VScode gives me an error (Unkown token: IDENT string).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unknown token IDENT aws_region - terraform - Stack Overflow
This error appears when you execute terraform 0.12upgrade and your code syntax is already in Terraform 0.12x or obviously a mix of syntax ......
Read more >
Getting errors when I run Terraform on VS Code: Unknown ...
The type = string for variable “resource_group_name” gets this error message: Unknown token:4:20 IDENT string [4,20] I cannot figure out how ...
Read more >
Why can't I validate my Terraform template? - IBM Cloud Docs
Error: Error parsing /file-path/main.tf: At 9:14: Unknown token : 9:14 IDENT var.resource_group. The Terraform version that you specify during the ...
Read more >
Unknown token: IDENT , when decoding/parsing terraform file
I am parsing main.tf file , so that I can use the arguments passed into the module in my go lang program. Terraform...
Read more >
hashicorp-terraform/Lobby - Gitter
If I comment out the type = map(string) line: Error while parsing: At 42:26: Unknown token: 42:26 IDENT merge. not really sure why...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found