1.0.0 • Published 4 years ago

generator-cfn-stack v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

CloudFormation template generator

Scaffolding for new AWS CloudFormation template projects.

Features

  • template.yaml, and parameters.json files to root path

  • .editorconfig, .gitignore, and .gitattributes files to root path

  • Option to choose a test framework:

  • test directory with an example test based on test framework selection

  • .pre-commit-config.yaml for cfn-lint, and other checks

Prerequisites

Installation

  1. Install nodejs pro tip: use nvm

  2. Install Yeoman

    npm install -g yo
  3. Install this generator

    npm install -g cfn-stack

Usage

To use the included generator execute the below command in shell and provide your new module name for the prompt

> yo cfn-stack
...
? Enter name for the new CloudFormation template:  example-module
? Enter description for the new CloudFormation template:  Example CloudFormation template
? Enter author name:  jdoe
? Choose test framework (use arrow keys)
❯ taskcat

Project layout generated for the new CloudFormation template with taskcat selection

hello_world
├── .editorconfig
├── .gitattributes
├── .gitignore
├── .pre-commit-config.yaml
├── README.md
├── template.yaml
├── parameters.json
├── events
│   └── event.json
├── functions
│   └── src
│       └── hello_world
│           ├── __init__.py
│           ├── lambda.py
│           └── requirements.txt
└── test

Post generation steps

  1. On the generated template's root path, initialize the git repository:

    git init
  2. On the generated template's root path, install pre-commit hooks:

    pre-commit install

Contribution

Found a bug? feel free to raise an issue. Pull requests are always welcome. Keen to review and merge.

Maintainer

This project is maintained by cgswong

License

MIT