Skip to content

mjaromi/hclvalidator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

HCL Validator

Simple HCL validator for *.tf and *.tfvars files.

Installation

$ sudo wget -O /usr/local/bin/hclvalidator https://raw.githubusercontent.com/mjaromi/hclvalidator/master/hclvalidator.py
$ sudo chmod +x /usr/local/bin/hclvalidator

Usage

hclvalidator [PATH]

If PATH is ommitted then the tool will read from current (.) directory.

Example

$ ls
variables.tfvars

$ cat variables.tfvars 
project_somevars = [
  { ENV_VAR_0 = "ENV_VAR_value_0" }
]

project_othervars = [
  { ENV_VAR_1 = "ENV_VAR_value_1" }
  { ENV_VAR_2 = "ENV_VAR_value_2" }
]

$ hclvalidator 
[./variables.tfvars] => [{ ENV_VAR_1 = "ENV_VAR_value_1" }] => [Line 7, column 121: unexpected LEFTBRACE; expected COMMA, IDENTIFIER, STRING, COMMENT, MULTICOMMENT, MINUS, NUMBER, FLOAT, $end, RIGHTBRACE, RIGHTBRACKET, RIGHTPAREN]

Releases

No releases published

Packages

No packages published

Languages