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

  • Provisioning scripts call rain deploy for each template under templates/, pairing it with the matching parameter file.
  • CI/CD workflows install the latest Rain release and run the deploy script on every push to main.
  • Local development encourages you to run 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

  • Pin a version: Set the RAIN_VERSION environment variable in the workflow before the install step to ensure consistency across runs.
  • Enable additional flags: Export RAIN_FLAGS="--changeset" (for example) and update the deploy script to append it to every Rain invocation.
  • Use profiles: Rain relies on your AWS CLI configuration. Set AWS_PROFILE or AWS_DEFAULT_REGION before running commands locally.

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