This is version 2. In this version, the env. prefix is used with system environmental variables.
A dummy test service yaml, executed with NAME=name STAGE=dev slsdev
name-dev: dev-service
envStage: ${env.STAGE}
envName: ${env.NAME}
name: ${${envName}-${envStage}} # first resolves to '${name-dev}' and then to 'dev-service'
# this is just a mock component, it only passes inputs to output
test-component:
component: "../env-vars"
inputs:
stage1: ${env.STAGE}
stage2: ${envStage}
name: ${name}
output is
test-component:
stage1: dev
stage2: dev
name: dev-service
This is version 2. In this version, the
env.
prefix is used with system environmental variables.A dummy test service yaml, executed with
NAME=name STAGE=dev slsdev
output is