aws-cloudformation-template-builder

module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2019 License: Apache-2.0

README

GitHub version Snap Status

Get it from the Snap Store

AWS Cloudformation Template Builder

This repository contains cfn-skeleton, a command line tool and Go library that consumes the published CloudFormation specification and generates skeleton CloudFormation templates with mandatory and optional parameters of chosen resource types pre-filled with placeholder values.

License

This project is licensed under the Apache 2.0 License.

Installation

You can install cfn-skeleton in one of the following three ways:

  • Use the snap package

  • If you have go installed, run the following:

    go install github.com/awslabs/aws-cloudformation-template-builder/cmd/cfn-skeleton

  • Download the latest release for your operating system.

Usage

cfn-skeleton [OPTIONS] [RESOURCE TYPES...]

  cfn-skeleton is a tool that generates skeleton CloudFormation templates
  containing definitions for the resource types that you specify.

  You can use a short name for a resource type so long as it is unambiguous.
  For example 'Bucket', 'S3::Bucket', and 'AWS::S3::Bucket' refer to the same type.
  But 'Instance' would need disambiguation.

Options:

  -b, --bare  Produce a minimal template, omitting all optional resource properties.
  -i, --iam   If any resource includes an IAM policy definition, populate that too.
  -j, --json  Output the template in JSON format (default: YAML).
  --help      Show this message and exit.

Resource names must be delimited by spaces. If you specify more than one of the same resource type, you will get multiple resources in the output template; cfn-skeleton will ensure that the names are unique by adding numbers.

Examples

Basic Usage
cfn-skeleton -b Bucket EC2::Instance

Output:

# Template generated by cfn-skeleton
AWSTemplateFormatVersion: "2010-09-09"

Resources:
  MyBucket:
    Type: AWS::S3::Bucket
    Properties:
      {}

  MyInstance:
    Type: AWS::EC2::Instance
    Properties:
      {}
Output JSON

To output JSON, use the -j or --json flag.

Note that JSON output will include comments that help you identify optional properties of CloudFormation resources; however, comments are not supported in the JSON specification and will be rejected by AWS CloudFormation. Once you have finished editing your template, ensure that you remove all comments.


cfn-skeleton -b -j Bucket

Output

{  // Template generated by cfn-skeleton
    "AWSTemplateFormatVersion": "2010-09-09",

    "Resources": {
        "MyBucket": {
            "Type": "AWS::S3::Bucket",
            "Properties": {}
        }
    }
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL