Migrating from rain¶
cfnrain starts from Rain v1.24.4 plus 22 later commits. Templates, config files, environment variables and the artifact bucket work as before. Most migrations only change the name of the binary.
Steps¶
- Install cfnrain.
-
Replace
rainwithcfnrainin your scripts and CI workflows. Or link the old name, so the scripts do not change. In GitHub Actions, replace the install step. See GitHub Actions. -
If an IAM role trust policy limits the session name, allow
cfnrain-*. See Role session name. - Remove the Rain binary or the Homebrew formula when you no longer need it.
What stays the same¶
| Item | Status |
|---|---|
!Rain::* directives |
Same |
The Rain: template section |
Same |
The Modules, Packages and Constants sections |
Same |
Metadata.Rain on S3 buckets |
Same |
Config files for --config |
Same |
RAIN_VAR_* and RAIN_DEFAULT_TAG_* |
Same |
Artifact bucket rain-artifacts-<account>-<region> |
Same bucket, cfnrain uses it as it is |
SSM parameter rain-bucket |
Same |
cc state files in the artifact bucket |
Same location |
CodeArtifact defaults for module (--domain cloudformation, --repo rain) |
Same |
| Flags and commands | Same |
What changed¶
Binary and module name¶
The command is cfnrain. The Go module is github.com/awesome-foundation/cfnrain. go install uses the new path:
cfnrain --version prints cfnrain v<version> <os>/<arch>. Scripts that parse the version output need an update.
GitHub Actions¶
allixsenos/install-rain installs Rain, and it is deprecated. Replace it with install-cfnrain:
# Before
- uses: allixsenos/install-rain@v1
# After
- uses: awesome-foundation/install-cfnrain@v1
with:
rain-alias: true
rain-alias: true also puts rain on the PATH, so steps that call rain work without changes. When your steps call cfnrain, remove the input.
User agent¶
AWS sees the user agent cfnrain/<version>, not Rain/<version>. If you filter CloudTrail events or write IAM conditions on the user agent, update them.
Role session name¶
When cfnrain assumes a role from your AWS profile, the role session name is cfnrain-<version>, not Rain-<version>. If a role trust policy only allows session names that match Rain-*, add cfnrain-*:
No analytics metadata¶
Rain added a Metadata.AWSToolsMetrics.Rain block to every packaged template. cfnrain does not. The --no-analytics flag is still accepted, and has no effect. If you compare packaged templates from Rain and cfnrain, expect this block to be the difference.
Documentation¶
The Rain documentation at aws-cloudformation.github.io/rain is frozen. This site replaces it. Some things in the old documentation are wrong:
- On
deploy,-xis--no-exec, not--experimental. See Experimental features. - The
Modulessection does not need--experimental. Only!Rain::Moduleand bucket metadata do. !Rain::S3takesFormat: URI, notUri. See S3 and S3Http.- The
ForEachplaceholders are$Identifierand$Index. There is no$MapValue. See ForEach. !Rain::Moduledoes not need aModuleExtensionresource orMetadata.Extends.- Packaged resources get no
SourceMapmetadata. !Rain::S3has noVersionPropertyoption.diff,mergeandtreedo not read Pkl files.
For behavior that is still wrong in the code, see Known issues.