For some use cases where there are a lot of config files, but all the differences are in the all section, it would be useful to have the other environments defined separately in a file that can be re-used for different stacks.
Primary configuration file (config.yml):
---
Environment: all
StackName: 'MyTestStack-{{ Environment }}'
Template: template.yml
Parameters:
Environment: '{{ Environment }}'
Capabilities:
- CAPABILITY_IAM
Environments configuration file (environments.yml):
---
Environment: dev
Region: us-east-1
---
Environment: test
Region: us-east-1
---
Environment: prod
Region: us-east-1
Then specifying --config-file config,yml --config-file environments.yml would use the combination of the two.
Some questions about this approach:
- If the same environment is defined in both files, will it try and merge the configuration, if so, which one wins?
For some use cases where there are a lot of config files, but all the differences are in the
allsection, it would be useful to have the other environments defined separately in a file that can be re-used for different stacks.Primary configuration file (config.yml):
Environments configuration file (environments.yml):
Then specifying
--config-file config,yml --config-file environments.ymlwould use the combination of the two.Some questions about this approach: