Skip to content

yurymkomarov/terraform-local-json-vars-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON vars parser

This module can parse JSON files with vars

Example of usage

For example: you have JSON file with global vars and component specific vars. Files and folders should have this structure:

.
├── component
│   ├── vars
│   │   ├── default.json
│   │   ├── dev.json
│   │   └── prod.json
│   ├── main.tf
│   ├── outputs.tf
│   └── variables.tf
└── vars.json

Your module call will look like this:

module "json_vars_parser" {
  source = "yurymkomarov/terraform-local-json-vars-parser"

  custom_vars = file("${path.root}/../vars.json")
}

After this you can have access to all variables from JSON files as module.json_vars_parser.results["${var_name}"]