Giter Club home page Giter Club logo

aws-cloudformation-template-formatter's Introduction

GitHub version Snap Status

Get it from the Snap Store

AWS CloudFormation Template Formatter

This repository contains cfn-format, a command line tool that reads in an existing AWS CloudFormation template and outputs a cleanly-formatted, easy-to-read copy of the same template adhering to standards as used in AWS documentation. cfn-format can output either YAML or JSON as desired.

License

This project is licensed under the Apache 2.0 License.

Installation

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

  • Use the snap package

  • Download the latest release for your operating system.

  • If you have Go (v1.12 or higher) installed, run the following:

    GO111MODULE=on go get github.com/awslabs/aws-cloudformation-template-formatter/cmd/cfn-format

Usage

If you're using vim, you can add the following to your .vimrc to automate running cfn-format when you save a .template file:

autocmd BufWritePost *.template silent !cfn-format -w % 2>/dev/null

Command-line tool

Usage: cfn-format [OPTION...] [FILENAME]

  AWS CloudFormation Format is a tool that reads a CloudFormation template
  and outputs the same template, formatted according to the same standards
  used in AWS documentation.

  If FILENAME is not supplied, cfn-format will read from STDIN.

Options:
  --help    Show this message and exit.
  -c, --compact   Produce more compact output.
  -j, --json      Output the template as JSON (default format: YAML).
  -v, --verify    Check if the input is already correctly formatted and exit.
                  The exit status will be 0 if so and 1 if not.
  -w, --write     Write the output back to the file rather than to stdout.

Go package documentation

The parse and format packages have moved to become part of rain.

To see the current Go documentation, please check the Rain source code.

aws-cloudformation-template-formatter's People

Contributors

stilvoid avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.