HCL language support

Compatible with: IntelliJ IDEA PhpStorm WebStorm PyCharm RubyMine AppCode CLion Gogland DataGrip Rider Android Studio
57 245
This plugin adds support for HashiCorp Configuration Language (HCL) and HashiCorp Interpolation Language (HIL) languages
And their combination, Terraform configuration files (.tf)
Also HCL format is used for Nomad(.nomad files).
Features: For file formats with HCL (.hcl, .tf, .nomad):
  • Syntax highlighting
  • Structure outline in 'Structure' tool window
  • Code formatter, so reformat code action available
  • Code folding
  • Comment/Uncomment action
HashiCorp Interpolation Language:
  • Syntax highlighting
Terraform specific support: In both config and interpolations:
  • Autocompletion
  • Find Usages / Go to definition for resources, providers, variables and their properties
  • Rename Refactoring
  • Introduce Variable Refactoring (for string property values)
  • Several inspections
  • Report usage of deprecated properties
  • Unresolved reference checks (in interpolations)
  • Check required/missing properties in resource/provider
  • Predefined Terraform methods autocompletion in interpolations
  • (WIP) Better properties validation (type checking)
  • (WIP) Working with dependent modules
  • (WIP) Type-specific autocompletion in interpolations

Download plugin

Recent change notes


Support for `backend` blocks in `terraform` block

Custom folding support: `region/endregion` and `<editor-fold>

Required properties added automatically on resource/data type completion and in generators

Smart completion in interpolations provides best suited results for some properties, e.g. vpc_id in aws resources

Move statement up/down doesn't breaks syntax anymore

Other improvements and bugfixes in completion

Updated model data to match Terraform v0.9.5


Support `${terraform.env}` interpolation

Improve resolving for 'computed' map variables

Updated model data to match Terraform v0.9.4


Added 'Add missing variable' quick fix

Do not highlight terraform_remote_state parameters as missing

Updated Terraform model data to match TF v0.9.3


Added 'Introduce Variable' refactoring (#50)

Resource and Data Source completion variants for unused providers no longer shown in basic completion (#77)

Added completion, Go To Definition and find usages from module 'source' property for relative path cases (#73)

Updated terraform model data to match Terraform v0.9.0

Updated terraform model data to match Terraform v0.8.6

Minor internal refactoring, plugin size reduced a bit

Support 'terraform' blocks in .tf files (#68)

Updated terraform model data to match Terraform v0.8.4


Allow 'self' references in interpolation in resource connection blocks (#57)

Support comparison and boolean operations in interpolation (#59)

Report incorrect argument types for comparison, ternary and boolean operations in interpolations (simple cases only)

Properly insert closing curve brace once interpolation start typed (#63)

Fixed 'module' keyword highlighting and completion in interpolations (#62)

Completion for module output in interpolations, module inputs no longer advised in interpolations completion (#52)

Added completion for module parameters as well as 'missing parameter' inspection (#65, #66)

Updated terraform model data to match Terraform v0.8.1

Fixed IAE (#55)

Fixed incorrect backslash escape handling (#56)

Removed Otto support since that tool was decommissioned


Support Terraform 0.8.0

'Missing required property' inspection now ignores required properties with 'default' value. (#53)

Multiline string literals supported only if there's interpolation inside.

Backslash escaping changed in interpolations to match Terraform 0.8 style. Details in HCL repo.

Do not highlight interpolation elements as unresolved reference for some holders, e.g. `VAR` in `data.consul.NAME.var.VAR` (#51)

Updated terraform model data to match Terraform v0.8.0-rc1


'Copy Reference' action would copy FQN of resource, provider, etc. (#48)

Updated terraform model data to match Terraform 0.7.5 (#49)


Updated terraform model data to match Terraform 0.7.4


Add references and completion variants for 'depends_on' in resources and data sources (#43)

Updated terraform model data to match Terraform 0.7.2


Fixed incorrect inspection in .tfvars files for numeric values (#41)

Fixed double quote inserter in Terraform files, now closing double quote would be added automatically if needed

Improved missing properties generation in 'Missing required property' inspection based on expected property type

Improved property name completion elements presentation

Variable type could be autocompleted from three variants: string, list or map

Variable type inspection (for 'type' and 'default' properties)

Report duplicated providers with same name/alias as error

Report usage of interpolations in variables, 'depends_on' and module source as error


Fixed incorrect inspection in .tfvars files (#39)

Support references to elements of 'map' variables in .tfvars files (#41)

Code completion in .tfvars files (#41)

Support multiline interpolations in heredocs (#40)


Support Terraform 0.7.0 (issues: #31, #33, #36, #37)

Updated terraform model data to match Terraform 0.7.0


Fixed error on rename refactoring (issue #29)

Fixed parsing heredocs with indented end token (issue #30)

Fixed interpolation escape (`$$`) (issue #34)

Updated terraform model data to match Terraform 0.6.16


Updated terraform model data to match Terraform 0.6.15 (issue #28)


Updated terraform model data to match Terraform 0.6.14

Support indented heredocs (issue #27)

Support '.tfvars' files (issue #24)

Fixed exception during formatting a .tf file with invalid syntax (issue #26)


Updated terraform model data to match Terraform 0.6.12

Fix references to resource 'id' property reported as unresolved (issue #21)

Fixes around unary operators in HIL

Support indexing into variables in HIL ('${a[2]}') (issue #19)

Various fixes


Customize highlighting text attributes (colour, etc)

Improved Find Usages, Go to definition, Rename refactoring support.

Support custom language injections in heredoc (issue #17)

Added inspections in Terraform interpolations: incorrect use of 'self', 'unknown resource type', 'unresolved reference'

Added actions into 'Generate ...' popup. Use with alt+insert(ctrl+n on OSX)


Added 'deprecated parameter or block type' inspection.

Updated terraform model data to match Terraform 0.6.11

Minor internal refactoring


Updated terraform model data to match Terraform 0.6.8


Fix false 'unknown block' inspection result (issue #12)

Fix compatibility with non IDEA IDEs (issue #13)


Fix ClassCastException (issue #11)


Autocompletion in interpolations

Go to definition from interpolations to provider/resources properties, etc.

Find usages of provider/resources properties, etc. in interpolations

Inplace properties renaming (with usages tracking)

Previous changes see in sources repository