Skip to main content

Configuration files

File structure

Both the configuration file and the parameters-map file share the same simple structure - they are both .json files containing an object where all its properties are strings.

A config file may look like this:

{
"param1": "value1",
"param2": "value2"
}

Configuration files

A configuration file is just a mapping from configuration-keys to values. All of which are strings.

Configuration mapping

It is possible for a configuration-set to contain values with configuration keys that differ from the parameters that a project requires. It is also possible for a configuration-set to contain a single value that may be used for several project's parameters.

For these cases, a parameter-mapping file can be used. The parameter-map file is a simple .json file that maps project parameters to configuration-set value keys.

Suppose our example config.json file:

{
"param1": "value1",
"param2": "value2"
}

A project that expects the following parameters:

  • param1
  • PARAM_2
  • p2

And that our configuration param2 can satisfy both PARAM_2 and p2.

We can create the following parameter-map file map.json:

{
"PARAM_2": "param2",
"p2": "param2"
}

And then deploy, or compile, our project using that file with the --parameter-map option:

alto deploy stack-name:version-name \
--config-set config.json \
--parameter-map map.json
alto compile --config-set config.json --parameter-map map.json

Ready to Get Started?

Get Started for Free
© 2023 Altostra, Inc.