Provides HCL language and Terraform configuration files (.tf
) support for IntelliJ Platform-based IDEs
The HCL format is used for Nomad(.nomad
files).
Plugin page in IntelliJ platform plugin repository.
- Syntax highlighting
- Structure outline in the 'Structure' tool window
- Code formatter with the 'Reformat code' action available
- Code folding
- Comment/Uncomment action
- Interpolations syntax highlighting
- (WIP) Properties validation (according to the properties required for resource/provider, type checking)
- (WIP) Go to definition from resource to provider
- Syntax highlighting
- Autocompletion for predefined methods
- (WIP) Go to declaration on resources, providers, properties, etc.
- Find usages for resources, providers, variables
Starting from version 0.6.14 it's possible to use external source of Terraform model. Previously plugins updates were necessary once something was updated in Terraform itself or providers.
Plugin reads metadata from specially-formatted json files located at (in order):
TERRAFORM_GLOBAL_DIR/schemas
(intended for schemas for your custom providers/provisioners) andTERRAFORM_GLOBAL_DIR/metadata-repo/terraform/model
(semi-automatically updated schemas) and- Plugin itself
Here TERRAFORM_GLOBAL_DIR
stands for $HOME/.terraform.d
on Linux/macOS and %APPDATA%/terraform.d
on Windows.
ℹ️ Recommended approach is to clone special repo as TERRAFORM_GLOBAL_DIR/metadata-repo
and later update it from time to time.
Linux/macOS user may use commands like:
# To initial clone
mkdir -p "$HOME/.terraform.d/"
git clone https://github.com/VladRassokhin/terraform-metadata "$HOME/.terraform.d/metadata-repo"
# To update metadata
git -C "$HOME/.terraform.d/metadata-repo" pull
# Don't forget to restart IntelliJ after that