Describe and deploy cloudformatnion tempaltes with flexibility to apply scripted transformatnions.
- Better control for conditional resources
- Dependency management
- Template transformations
- No more !If inside a template
npm install cfnmate
npx cfnmate --help
Prepare dir with:
- my-template.yaml that needs parameter "Env"
- cfnmate.config.js
module.exports = (params) => ({
stackName: `my-stack-${params.Env}`
})
Command:
cfnmate deploy my-template.yaml Env=dev
const { resourceTransform } = require('cfnmate/plugins')
module.exports = ({ Env, Bucket, Version }) => ({
stackName: `my-stack-${Env}`,
plugins: [
resourceTransform({
LambdaFunction({ Properties }) {
Properties.Code = {
S3Bucket: `${Bucket}-${Env}`,
S3Key: Version
}
}
})
]
})
Command:
cfnmate deploy my-template.yaml Env=dev Bucket=my-bucket Version=1.0
plugins: [
dependency('../path/to/another/template.taml', {
ParamForDependency: 'value'
})
]