rain

module
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: Apache-2.0

README

Unit tests Mentioned in Awesome CloudFormation

Rain

Rain is what happens when you have a lot of CloudFormation

Rain is also a command line tool for working with AWS CloudFormation templates and stacks.

Make it Rain

Discord

Join us on Discord to discuss rain and all things CloudFormation! Connect and interact with CloudFormation developers and experts, find channels to discuss rain, the CloudFormation registry, StackSets, cfn-lint, Guard and more:

Join our Discord

Key features

  • Interactive deployments: With rain deploy, rain packages your CloudFormation templates using aws cloudformation package, prompts you for any parameters that have not yet been defined, shows you a summary of the changes that will be made, and then displays real-time updates as your stack is being deployed. Once finished, you get a summary of the outcome along with any error messages collected along the way - including errors messages for stacks that have been rolled back and no longer exist.

  • Consistent formatting of CloudFormation templates: Using rain fmt, you can format your CloudFormation templates to a consistent standard or reformat a template from JSON to YAML (or YAML to JSON if you prefer). Rain preserves your comments when using YAML and switches use of intrinsic functions to use the short syntax where possible.

  • Combined logs for nested stacks with sensible filtering: When you run rain log, you will see a combined stream of logs from the stack you specified along with any nested stack associated with it. Rain also filters out uninteresting log messages by default so you just see the errors that require attention.

  • Build new CloudFormation templates: rain build generates new CloudFormation templates containing skeleton resources that you specify. This saves you having to look up which properties are available and which are required vs. optional.

  • Manipulate CloudFormation stack sets: rain stackset deploy creates a new stackset, updates an existing one or adds a stack instance(s) to an existing stack set. You can list stack sets using rain stackset ls, review stack set details with rain stackset ls <stack set name> and delete stack set and\or its instances with rain stackset rm <stack set name>

  • Predict deployment failures (EXPERIMENTAL): rain forecast analyzes a template and the target deployment account to predict things that might go wrong when you attempt to create, update, or delete a stack. This command speeds up development by giving you advanced notice for issues like missing permissions, resources that already exist, and a variety of other common resource-specific deployment blockers.

  • Modules (EXPERIMENTAL): rain pkg supports client-side module development with the !Rain::Module directive. Rain modules are partial templates that are inserted into the parent template, with some extra functionality added to enable extending existing resource types.

Note that in order to use experimental commands, you have to add --experimental or -x as an argument.

Getting started

If you have homebrew installed, brew install rain

Or you can download the appropriate binary for your system from the releases page.

Or if you're a Gopher, you can GO111MODULE=on go install github.com/aws-cloudformation/rain/cmd/rain

Usage:
  rain [command]

Stack commands:
  cat         Get the CloudFormation template from a running stack
  deploy      Deploy a CloudFormation stack from a local template
  logs        Show the event log for the named stack
  ls          List running CloudFormation stacks
  rm          Delete a running CloudFormation stack
  stackset    This command manipulates stack sets.
  watch       Display an updating view of a CloudFormation stack

Template commands:
  bootstrap   Creates the artifacts bucket
  build       Create CloudFormation templates
  diff        Compare CloudFormation templates
  fmt         Format CloudFormation templates
  forecast    Predict deployment failures
  merge       Merge two or more CloudFormation templates
  pkg         Package local artifacts into a template
  tree        Find dependencies of Resources and Outputs in a local template

Other Commands:
  console     Login to the AWS console
  help        Help about any command
  info        Show your current configuration

You can find shell completion scripts in docs/bash_completion.sh and docs/zsh_completion.sh.

Contributing

Rain is written in Go and uses the AWS SDK for Go v2.

To contribute a change to Rain, fork this repository, make your changes, and submit a Pull Request.

Go Generate

The README.md, documentation in docs/, the auto completion scripts and a copy of the cloudformation specification in cft/spec/cfn.go are generated through go generate.

License

Rain is licensed under the Apache 2.0 License.


Other CloudFormation tools

In alphabetical order:

  • cfn-lint

    Validate CloudFormation yaml/json templates against the CloudFormation spec and additional checks. Includes checking valid values for resource properties and best practices.

  • cfn-nag

    The cfn-nag tool looks for patterns in CloudFormation templates that may indicate insecure infrastructure.

  • taskcat

    taskcat is a tool that tests AWS CloudFormation templates. It deploys your AWS CloudFormation template in multiple AWS Regions and generates a report with a pass/fail grade for each region. You can specify the regions and number of Availability Zones you want to include in the test, and pass in parameter values from your AWS CloudFormation template. taskcat is implemented as a Python class that you import, instantiate, and run.

Are we missing an excellent tool? Let us know via a GitHub issue.

Directories

Path Synopsis
cft
Package cft provides the Template type that models a CloudFormation template.
Package cft provides the Template type that models a CloudFormation template.
build
Package build contains functionality to generate a cft.Template from specification data in cft.spec
Package build contains functionality to generate a cft.Template from specification data in cft.spec
diff
Package diff provides the Diff class that can be used to compare CloudFormation templates
Package diff provides the Diff class that can be used to compare CloudFormation templates
format
Package format contains functionality to render a cft.Template into YAML or JSON
Package format contains functionality to render a cft.Template into YAML or JSON
graph
Package graph provides functionality to build a graph of connected nodes with a cfn.Template
Package graph provides functionality to build a graph of connected nodes with a cfn.Template
parse
Package parse provides functions for parsing CloudFormation templates from JSON and YAML inputs.
Package parse provides functions for parsing CloudFormation templates from JSON and YAML inputs.
pkg
This file implements !Rain::Module
This file implements !Rain::Module
spec
Package spec contains generated models for CloudFormation and IAM
Package spec contains generated models for CloudFormation and IAM
cmd
internal
aws
Package aws contains functionality that wraps the AWS SDK
Package aws contains functionality that wraps the AWS SDK
cmd
cmd/forecast
Forecast looks at your account and tries to predict things that will go wrong when you attempt to CREATE, UPDATE, or DELETE a stack
Forecast looks at your account and tries to predict things that will go wrong when you attempt to CREATE, UPDATE, or DELETE a stack
console
Package console contains utility functions for working with text consoles
Package console contains utility functions for working with text consoles
console/spinner
Package spinner contains functions for displaying progress updates with a spinning icon that shows the user that progress is being made.
Package spinner contains functions for displaying progress updates with a spinning icon that shows the user that progress is being made.
dc
The dc package contains types and functions to facilitate parsing user-supplied configuration like tags and parameters, which are used for the deploy and forecast commands
The dc package contains types and functions to facilitate parsing user-supplied configuration like tags and parameters, which are used for the deploy and forecast commands
ui

Jump to

Keyboard shortcuts

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