Skip to content

Commit

Permalink
Merge pull request #194 from ericzbeard/waterfall
Browse files Browse the repository at this point in the history
Add Gantt chart output to rain logs command
  • Loading branch information
ericzbeard authored Sep 7, 2023
2 parents fe83ac4 + 5b5dc34 commit a4083ad
Show file tree
Hide file tree
Showing 33 changed files with 5,719 additions and 174 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cfn-lint, Guard and more:

* **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.

* **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.
* **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. You can also use `rain log --chart` to see a Gantt chart that shows you how long each operation took for a given stack.

* **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.

Expand Down Expand Up @@ -107,7 +107,7 @@ The template:
```yaml
Resources:
Test:
Type: AWS::CloudFormation:WaitHandle
Type: AWS::CloudFormation::WaitConditionHandle
Metadata:
Comment: !Rain::Embed embed.txt
```
Expand All @@ -122,7 +122,7 @@ The resulting packaged template:
```yaml
Resources:
Test:
Type: AWS::CloudFormation:WaitHandle
Type: AWS::CloudFormation::WaitConditionHandle
Metadata:
Comment: This is a test
```
Expand Down Expand Up @@ -406,6 +406,14 @@ Resources:
RestrictPublicBuckets: true
```

### Gantt Chart

Output a chart to an HTML file that you can view with a browser to look at how long stack operations take for each resource.

`rain log --chart CDKToolkit > ~/Desktop/chart.html`

<img src="./docs/chart.png" />

## Other CloudFormation tools

* [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint)
Expand Down
2 changes: 1 addition & 1 deletion cft/pkg/tmpl/embed-expect.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Resources:
Test:
Type: AWS::CloudFormation:WaitHandle
Type: AWS::CloudFormation::WaitConditionHandle
Metadata:
Comment: This is a test

2 changes: 1 addition & 1 deletion cft/pkg/tmpl/embed-template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Resources:
Test:
Type: AWS::CloudFormation:WaitHandle
Type: AWS::CloudFormation::WaitConditionHandle
Metadata:
Comment: !Rain::Embed embed.txt

4,528 changes: 4,398 additions & 130 deletions cft/spec/cfn.go

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions docs/README.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cfn-lint, Guard and more:

* **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.

* **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.
* **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. You can also use `rain log --chart` to see a Gantt chart that shows you how long each operation took for a given stack.

* **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.

Expand Down Expand Up @@ -81,7 +81,7 @@ The template:
```yaml
Resources:
Test:
Type: AWS::CloudFormation:WaitHandle
Type: AWS::CloudFormation::WaitConditionHandle
Metadata:
Comment: !Rain::Embed embed.txt
```
Expand All @@ -96,7 +96,7 @@ The resulting packaged template:
```yaml
Resources:
Test:
Type: AWS::CloudFormation:WaitHandle
Type: AWS::CloudFormation::WaitConditionHandle
Metadata:
Comment: This is a test
```
Expand Down Expand Up @@ -380,6 +380,14 @@ Resources:
RestrictPublicBuckets: true
```

### Gantt Chart

Output a chart to an HTML file that you can view with a browser to look at how long stack operations take for each resource.

`rain log --chart CDKToolkit > ~/Desktop/chart.html`

<img src="./docs/chart.png" />

## Other CloudFormation tools

* [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint)
Expand Down
4 changes: 4 additions & 0 deletions docs/bash_completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,10 @@ _rain_logs()
flags+=("-a")
local_nonpersistent_flags+=("--all")
local_nonpersistent_flags+=("-a")
flags+=("--chart")
flags+=("-c")
local_nonpersistent_flags+=("--chart")
local_nonpersistent_flags+=("-c")
flags+=("--help")
flags+=("-h")
local_nonpersistent_flags+=("--help")
Expand Down
Binary file added docs/chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Rain is a command line tool for working with AWS CloudFormation templates and st
* [rain tree](rain_tree.md) - Find dependencies of Resources and Outputs in a local template
* [rain watch](rain_watch.md) - Display an updating view of a CloudFormation stack

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain bootstrap

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain build [<resource type>...]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_cat.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ rain cat <stack>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_console.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ rain console [stack]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ rain deploy <template> [stack]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ rain diff <from> <to>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_fmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ rain fmt <filename>...

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_forecast.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ rain forecast --experimental <template> [stackName]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain info

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
5 changes: 3 additions & 2 deletions docs/rain_logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Show the event log for the named stack

### Synopsis

Shows the event log for a stack and its nested stack. Optionally, filter by a specific resource by name.
Shows the event log for a stack and its nested stack. Optionally, filter by a specific resource by name, or see a gantt chart of the most recent stack action.

By default, only show log entries that contain a useful message (e.g. a failure message).
You can use the --all flag to change this behaviour.
Expand All @@ -17,6 +17,7 @@ rain logs <stack> (<resource>)

```
-a, --all include uninteresting logs
-c, --chart Output a gantt chart of the most recent action as an html file
-h, --help help for logs
-p, --profile string AWS profile name; read from the AWS CLI configuration file
-r, --region string AWS region to use
Expand All @@ -33,4 +34,4 @@ rain logs <stack> (<resource>)

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_ls.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain ls <stack>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ rain merge <template> <template> ...

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_pkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ rain pkg <template>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_rm.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ rain rm <stack>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_stackset.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ This command manipulates stack sets. It has no action if specific stack set comm
* [rain stackset ls](rain_stackset_ls.md) - List a CloudFormation stack sets in a given region
* [rain stackset rm](rain_stackset_rm.md) - Delete a CloudFormation stack set and/or its instances.

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_stackset_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ rain stackset deploy <template> [stackset] [flags]

* [rain stackset](rain_stackset.md) - This command manipulates stack sets.

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_stackset_ls.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain stackset ls <stack set>

* [rain stackset](rain_stackset.md) - This command manipulates stack sets.

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_stackset_rm.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain stackset rm <stackset>

* [rain stackset](rain_stackset.md) - This command manipulates stack sets.

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain tree [template]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
2 changes: 1 addition & 1 deletion docs/rain_watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain watch <stack>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Aug-2023
###### Auto generated by spf13/cobra on 6-Sep-2023
Loading

0 comments on commit a4083ad

Please sign in to comment.