1.1.1 • Published 6 years ago

@u-minor/cftemplate v1.1.1

Weekly downloads
113
License
MIT
Repository
github
Last release
6 years ago

cftemplate

AWS CloudFormation YAML template generator.

Write separated YAMLs, build them into one CF template!

Build Status Coverage Status

Installation

Global install

$ npm install @u-minor/cftemplate -g

or install and add to current package.

$ npm install @u-minor/cftemplate --save-dev

Quick start

Make separated YAMLs by using json-refs, and put them info your source directory.

Template example

Then, build template like below.

$ cftemplate srcdir > template.yml

Command reference

Usage: cftemplate [options] <dir>

Options:
  --version     Show version number                                    [boolean]
  -e, --entry   entry point file name            [string] [default: "index.yml"]
  -o, --output  output file name                                        [string]
  --help, -h    Show help                                              [boolean]

Writing templates

Make index.yml (default entry point) like below.

If you want to change it, use --entry option.

You can use $ref to refer another template. (See json-refs for more information)

AWSTemplateFormatVersion: '2010-09-09'
Description: Your project template

Mappings:
  $ref: mappings.yml

Outputs:
  $ref: outputs.yml

Parameters:
  $ref: parameters.yml

Resources:
  $ref: .resources.yml

If the template name starts with . (like .resources.yml), cftemplate try to merge all templates under the same directory (like resources).

So you can create yaml files separately for each AWS resource type like resources/CloudFront.yml, resources/S3.yml, etc.

Directory tree example:

cf/
├── index.yml
├── mappings.yml
├── outputs.yml
├── parameters.yml
└── resources/
    ├── CloudFront.yml
    ├── Lambda.yml
    └── S3.yml
1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago