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.

Terraform Interpolation Syntax Highlighted as Syntax Error in Pycharm

See original GitHub issue

Installation details

  • IDE version (Help->About->Copy to Clipboard) PyCharm 2018.1.4 (Professional Edition) Build #PY-181.5087.37, built on May 24, 2018 Licensed to Tarun Tomar Subscription is active until July 6, 2018 JRE: 1.8.0_152-release-1136-b39 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.13.5

  • intellij-hcl plugin version (Settings->Plugins) 0.6.11

  • Terraform version (terraform -v) 0.11.7

Terraform Configuration Files

key_name = "${format("%s-Bastion-%s", var.ProjectName, var.RegionName)}" 

Exception

Should not highlight any errors.

Expected Behavior

PyCharm should not highlight any error

Actual Behavior

Throws syntax error. Making the remaining code styling/highlights fail.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. use the terraform interpolation to format a a variable value using couple of other variables, such as:

var1 = “abc” var2 = “${format(”%s", var.var1)}"

Upon hovering the mouse to the highlighted syntax error, it reads:

',' or '}' expected, got '%'

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
VladRassokhincommented, Jul 4, 2018

Ok. If you spot some problems don’t hesitate to open new issues.

1reaction
taruntmrcommented, Jul 4, 2018

Hi,

Thanks for all your responses and time and effort for this awesome plugin.

I had associated the *.tf with HCL Interpolation Language and hence the syntax issue.

All seems to be working fine now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Terraform and HCL - IntelliJ IDEs Plugin - JetBrains Marketplace
Adds syntax highlighting for HCL and HIL files. ... Interpolation Language (HIL), as well as their combination used in Terraform configuration files (.tf)....
Read more >
Terraform interpolation syntax error for data template_file
Either way, it seems like the syntax error is on line 280 column 49 of your handler.js file and is caused by Terraform's...
Read more >
awesome-vscode | A curated list of delightful VS Code ...
A curated list of delightful VS Code packages and resources.
Read more >
An Introduction to Terraform - Gruntwork Blog
This blog post corresponds to Chapter 2 of Terraform Up & Running, “An Intro to Terraform Syntax,” so look for the code samples...
Read more >
SweetOps #terraform for April, 2020
Anyone else using pycharm and the HCL plugin for terraform work? ... Hello, I am using Vscode and was looking for syntax highlight...
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