Skip to content

mu yml env variables

Jeff Bachtel edited this page Sep 15, 2018 · 3 revisions

mu environment variables

mu allows users to refer to local environment variables within mu.yml, using the special syntax:

${env:XXXXXX}

Lines containing this pattern are replaced with the environment variables of the user's local environment at the time of parsing.

This syntax ${env:XXXX} was chosen to distinguish the intention of local environment substitution from other uses of ${XXXX} in CloudFormation, that lack the env: prefix.

Although this feature is originally envisioned as being used for yaml values (after the : character), there may also be an occasional use for yaml keys. As implemented, the environment variable substitution occurs on a line-by-line basis during the parsing of the mu.yml.

NOTE: This effectively makes the environment an input to mu itself, so if you use this feature extensively, you probably want to consider a way of controlling this environment via the creation of a setenv.sh file. Otherwise you may have difficulties in replicating results from one user or system to another.

See the example mu.yml in the directory ./examples/mu-yml-env-variables.