Skip to content

Commit

Permalink
Improve UI and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
stilvoid committed Nov 12, 2020
1 parent 064fc52 commit 99a221f
Show file tree
Hide file tree
Showing 49 changed files with 675 additions and 1,279 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- run: |
apt-get update && \
apt-get install -y hub zip && \
apt-get install -y awscli hub zip && \
go get -u golang.org/x/lint/golint
- run: |
Expand Down
103 changes: 22 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,33 @@
![Build badge](https://codebuild.eu-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiWjJrNU1WSTg0OUswalBkRWFWQnVTeDk4Zm8xTGNiQ0NUNnNuYkxWWjZHcnNWMzlXOHZzMVJwTE1QTzFqcFNyTisxWmVPc0d6TFVnMnVNZjZRY2FyQmRNPSIsIml2UGFyYW1ldGVyU3BlYyI6IkE5K0tnNU5YRmQ3ZWE5VHUiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=develop)

# Rain

> Rain is what happens when you have a lot of CloudFormation
*Rain is currently in preview and shouldn't yet be considered stable enough for production use.*

Please report any bugs you find [through GitHub issues](https://github.com/aws-cloudformation/rain/issues).
* Documentation: <https://aws-cloudformation.github.io/rain/>

You can read the full documentation at <https://aws-cloudformation.github.io/rain/>.

Here's what rain looks like:
> Rain is what happens when you have a lot of CloudFormation
[![Make it Rain](https://asciinema.org/a/269609.png)](https://asciinema.org/a/269609?autoplay=1)
Rain is also a command line tool for working with [AWS CloudFormation](https://aws.amazon.com/cloudformation/) templates and stacks.

## Installing
[![Make it Rain](./docs/rain.svg)](https://asciinema.org/a/vtbAXkriC0zg0T2UzP0t63G4S?autoplay=1)

You can download the appropriate binary for your system from [the releases page](https://github.com/aws-cloudformation/rain/releases).
Key features:

Alternatively, if you have [Go](https://golang.org) (v1.12 or higher) installed:
* **Interactive deployments**: With `rain deploy`, rain packages your CloudFormation templates using [`aws cloudformation package`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudformation/package.html), 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.

`GO111MODULE=on go get github.com/aws-cloudformation/rain`
* **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](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html) to use the short syntax where possible.

You can find shell completion scripts in [docs/bash_completion.sh](./docs/bash_completion.sh) and [docs/zsh_completion.sh](./docs/zsh_completion.sh).
* **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.

Rain requires the [AWS CLI](https://aws.amazon.com/cli/) to package CloudFormation templates for deployment. (See the `[aws cloudformation package](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/package.html) command for details.)
* **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.

## License
## Getting started

Rain is licensed under the Apache 2.0 License.
If you have [homebrew](https://brew.sh/) installed, `brew install rain`

## Usage
Or you can download the appropriate binary for your system from [the releases page](https://github.com/aws-cloudformation/rain/releases).

You will need to make sure you have installed and configured [the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) as rain uses the same credentials and configuration.
Or if you're a [Gopher](https://blog.golang.org/gopher), you can `GO111MODULE=on go get github.com/aws-cloudformation/rain/cmd/rain`

Rain is composed of a number of sub-commands. Run `rain` without any arguments to get help.
Rain requires the [AWS CLI](https://aws.amazon.com/cli/) to package CloudFormation templates when you use `rain deploy`.
(See the [`aws cloudformation package`](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/package.html) command for details.)

```
Usage:
Expand All @@ -50,7 +43,6 @@ Stack commands:
Template commands:
build Create CloudFormation templates
check Validate a CloudFormation template against the spec
diff Compare CloudFormation templates
fmt Format CloudFormation templates
merge Merge two or more CloudFormation templates
Expand All @@ -59,68 +51,21 @@ Template commands:
Other Commands:
help Help about any command
info Show your current configuration
Flags:
--debug Output debugging information
-h, --help help for rain
-p, --profile string AWS profile name; read from the AWS CLI configuration file
-r, --region string AWS region to use
Use "rain [command] --help" for more information about a command.
```

## Design Principles

Rain is designed with the following principles in mind:

### Do the most obvious and useful thing by default

The default behaviour for every feature of rain should:
* do what you would expect from the name
* output only the most pertinent information
* have a high signal to noise ratio

Examples:

* `ls` lists stacks in the current region, showing only the stack name and status

### Have consistent options available for non-default behaviour

While the default behaviour should stick to the obvious, every command should offer options for other use cases.

Examples:

* `-a | --all` shows information that would otherwise be filtered:
* `ls -a` lists stacks in all regions
* `logs -a` shows uninteresting logs

* `-l | --long` shows more detailed information:
* `logs -l` shows all available log details

### Be human-friendly

Output should:
* be easy to read, making good use of white-space while taking up the minimum of space needed to convey the important information
* use colour to highlight things the user needs to be aware of
* use colour to differentiate different kinds of information
* show progress so that the user knows we haven't crashed
You can find shell completion scripts in [docs/bash_completion.sh](./docs/bash_completion.sh) and [docs/zsh_completion.sh](./docs/zsh_completion.sh).

Examples:
## Contributing

* All commands colourise the stack/resource status
* `logs` colours the message field so that it stands out
* `deploy` shows a "spinner" while working
Rain is written in [Go](https://golang.org/) and uses the [AWS SDK for Go v2](https://github.com/aws/aws-sdk-go-v2).

### Be machine-friendly
To contribute a change to Rain, just [fork this repository](https://github.com/aws-cloudformation/rain/fork), make your changes, and submit a Pull Request.

Output should:
* be consumable by other processes; use YAML where possible
* strip special formatting when it is part of a pipe
## License

Examples:
Rain is licensed under the Apache 2.0 License.

* All commands have YAML-compatible output
* All commands strip formatting if stdout is not connected to a terminal
---

## Other CloudFormation tools

Expand Down Expand Up @@ -150,10 +95,6 @@ In alphabetical order:

Sceptre is a tool to drive CloudFormation. Sceptre manages the creation, update and deletion of stacks while providing meta commands which allow users to retrieve information about their stacks.

* [takomo](https://takomo.io)

Takomo makes it easy to organize, parameterize and deploy CloudFormation stacks across multiple regions and accounts. You can also manage your AWS organization, including its member accounts, organizational units and policies.

* [taskcat](https://github.com/aws-quickstart/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.
Expand Down
5 changes: 4 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ for platform in ${!PLATFORMS[@]}; do

mkdir -p "$OUTPUT_DIR/$full_name"

eval GOOS=$platform GOARCH=$architecture ${VARIANTS[$variant]} go build -o "$OUTPUT_DIR/${full_name}/${bin_name}" ./cmd/rain
bin_path="$OUTPUT_DIR/$full_name/$bin_name"

eval GOOS=$platform GOARCH=$architecture ${VARIANTS[$variant]} go build -ldflags=-w -o "$bin_path" ./cmd/rain

cp LICENSE "$OUTPUT_DIR/$full_name"
cp README.md "$OUTPUT_DIR/$full_name"

Expand Down
15 changes: 0 additions & 15 deletions cft/validate/errors.go

This file was deleted.

Loading

0 comments on commit 99a221f

Please sign in to comment.