Rain

Understand how the Rain CLI powers deployments in the CloudFormation starter kit.


What is Rain?

Rain is a command-line tool that streamlines CloudFormation workflows. It can deploy, diff, and remove stacks while handling change sets and parameter files for you. The starter kit wraps Rain so every environment follows the same deployment path locally and in CI/CD.

How the Starter Kit Uses Rain

Integration PointDescription
Provisioning scriptsCalls rain deploy for each template under templates/, pairing it with the matching parameter file
CI/CD workflowsInstalls latest Rain release and runs deploy script on every push to main
Local developmentEncourages running Rain directly for previews or change sets before pushing

The default command executed by the deploy script looks like this:

rain deploy "templates/<name>.yml" --yes --config "parameters/<environment>/<name>.yml"
  • --yes suppresses interactive prompts so automated runs stay non-blocking.
  • --config loads environment-specific parameters, tags, and stack options.

Useful commands

Run these from the repository root after installing Rain:

# Preview a stack without applying it
rain deploy templates/oidc-provider.yml --config parameters/test/oidc-provider.yml --changeset

# Deploy all templates for the test environment via the helper script
./scripts/deploy-templates.sh -e test

# Remove a stack that Rain previously deployed
rain rm github-oidc-provider --yes

See the full command reference in the Rain documentation.

Customizing Rain Usage

CustomizationMethod
Pin a versionSet RAIN_VERSION environment variable in workflow before install step to ensure consistency
Enable additional flagsExport RAIN_FLAGS="--changeset" and update deploy script to append to every Rain invocation
Use profilesRain relies on AWS CLI configuration; set AWS_PROFILE or AWS_DEFAULT_REGION before running locally

Need to understand how parameters feed into Rain? Review the Parameters reference.