Overview
Rain is a command-line tool that streamlines CloudFormation workflows. It deploys, diffs, and removes stacks while handling change sets and parameter files automatically.
How the starter kit uses Rain
| Integration Point | Description |
|---|---|
| Deploy script | Calls rain deploy for each template, pairing it with the matching parameter file |
| CI/CD workflows | Installs latest Rain release and runs deploy script on every push to main |
| Local development | Run Rain directly for previews or change sets before pushing |
Default deploy command
The deploy script executes:
rain deploy "templates/<name>.yml" --yes --config "parameters/<environment>/<name>.yml"
| Flag | Purpose |
|---|---|
--yes | Suppresses interactive prompts so automated runs stay non-blocking |
--config | Loads environment-specific parameters, tags, and stack options |
Common commands
Preview changes
rain deploy templates/oidc-provider.yml \
--config parameters/test/oidc-provider.yml \
--changeset
Shows exactly what CloudFormation will create, modify, or destroy. Review before approving.
Deploy templates
# Single template
rain deploy templates/oidc-provider.yml \
--config parameters/test/oidc-provider.yml \
--yes
# All templates via helper script
./scripts/deploy-templates.sh -e test
Check stack status
# List stacks
rain ls
# List all stacks (including deleted)
rain ls --all
View stack template
rain cat my-stack-name
Displays the current template for a deployed stack.
Remove a stack
rain rm my-stack-name --yes
Destroys all resources in the stack. CloudFormation handles deletion order.
View stack outputs
aws cloudformation describe-stacks \
--stack-name my-stack-name \
--query 'Stacks[0].Outputs'
Customizing Rain usage
| Customization | Method |
|---|---|
| Pin a version | Set RAIN_VERSION environment variable in workflow before install step |
| Enable additional flags | Export RAIN_FLAGS="--changeset" and update deploy script to append to every invocation |
| Use profiles | Rain uses AWS CLI configuration; set AWS_PROFILE or AWS_DEFAULT_REGION before running |
Rain vs AWS CLI
| Feature | Rain | AWS CLI |
|---|---|---|
| Change sets | Built-in with --changeset | Requires multiple commands |
| Parameter files | Native support via --config | Requires manual formatting |
| Stack events | Real-time streaming | Requires polling |
| Diff view | Color-coded template comparison | Not available |
| Error messages | Human-readable | Technical |
Next steps
- Parameters reference - How parameter files feed into Rain
- Scripts reference - Deploy script details
- Local Development - Daily workflow with Rain