0.0.4 • Published 5 years ago
@magicmark/cf-merge v0.0.4
💥 cf-merge
cf-merge brings import syntax to CloudFormation templates. Split up and modularize your stacks!
Example
Use top-level imports to merge in other templates:
# @import ./networking.yml
# @import ./security.yml
AWSTemplateFormatVersion: 2010-09-09
Parameters:
- foo
Resources:
- bar
Use inline imports to merge in sections of other templates:
AWSTemplateFormatVersion: 2010-09-09
Parameters:
- foo
# @import ./ec2_instances.yml#Parameters
Resources:
- bar
# @import ./ec2_instances.yml#Resources
See the tests to see examples of this in action.
Usage
cf-merge is distributed as a nodejs package. You can install it via npm or yarn:
yarn add @magicmark/cf-merge
You can then call cf-merge
in your bash script when calling aws cloudformation deploy
:
aws cloudformation deploy \
--region $REGION \
--profile $CLI_PROFILE \
--stack-name $STACK_NAME \
--template-file "$(yarn cf-merge main.yml --tmpfile)" \
CLI API Docs
cf-merge <file>
Positionals:
file path to a CloudFormation template file [string]
Options:
--version Show version number [boolean]
--help Show help [boolean]
--path, -p output file path (will print output to stdout if not specified)
[string]
--tmpfile, -t print template to a tmpfile. prints the filepath to stdout.
[boolean] [default: false]