## rain deploy

Deploy a CloudFormation stack or changeset from a local template

### Synopsis

Creates or updates a CloudFormation stack named <stack> from the template file <template>. 
You can also create and execute changesets with this command.
If you don't specify a stack name, rain will use the template filename minus its extension.

If a template needs to be packaged before it can be deployed, rain will package the template first.
Rain will attempt to create an S3 bucket to store artifacts that it packages and deploys.
The bucket's name will be of the format rain-artifacts-<AWS account id>-<AWS region>.

You can configure parameters and tags for your stack in several ways. The command-line flags --params
and --tags always take precedence over other sources. If you specify a config file using the --config
flag, parameters and tags in this file will be used unless they are overridden by command-line
arguments.

The config file format is similar to the AWS CodePipeline "Template configuration file", but it
does not include the 'StackPolicy' key, and may be in either YAML or JSON format.

If a parameter or tag is not specified through command-line flags or the config file,
you can also provide defaults through environment variables. Use variables prefixed with
RAIN_VAR_* for parameters, and RAIN_DEFAULT_TAG_* for tags.

For reference, here are example formats for the config file:

JSON:
  {
    "Parameters" : {
      "NameOfTemplateParameter" : "ValueOfParameter",
      ...
    },
    "Tags" : {
      "TagKey" : "TagValue",
      ...
    }
  }

YAML:
  Parameters:
    NameOfTemplateParameter: ValueOfParameter
    ...
  Tags:
    TagKey: TagValue
    ...

To create a changeset (with optional stackName and changeSetName):

rain deploy --no-exec <template> [stackName] [changeSetName]

To execute a changeset:

rain deploy --changeset <stackName> <changeSetName>

To list and delete changesets, use the ls and rm commands.


```
rain deploy <template> [stack]
```

### Options

```
      --changeset                execute the changeset, rain deploy --changeset <stackName> <changeSetName>
  -c, --config string            YAML or JSON file to set tags and parameters
  -d, --detach                   once deployment has started, don't wait around for it to finish
      --experimental             Acknowledge that you want to deploy with an experimental feature
  -h, --help                     help for deploy
      --ignore-unknown-params    Ignore unknown parameters
  -k, --keep                     keep deployed resources after a failure by disabling rollbacks
      --nested-change-set        Whether or not to include nested stacks in the change set (default true)
      --no-analytics             Do not write analytics to Metadata
  -x, --no-exec                  do not execute the changeset
      --node-style string        Set the node output style to tagged, doublequoted, singlequoted, literal, folded, strict-boolean, quotescalars, original, or flow (default "original")
      --params strings           set parameter values; use the format key1=value1,key2=value2
  -p, --profile string           AWS profile name; read from the AWS CLI configuration file
  -r, --region string            AWS region to use
      --role-arn string          ARN of an IAM role that CloudFormation should assume to deploy the stack
      --s3-bucket string         Name of the S3 bucket that is used to upload assets
      --s3-owner string          The account where S3 assets are stored
      --s3-prefix string         Prefix to add to objects uploaded to S3 bucket
      --tags strings             add tags to the stack; use the format key1=value1,key2=value2
  -t, --termination-protection   enable termination protection on the stack
  -y, --yes                      don't ask questions; just deploy
```

### Options inherited from parent commands

```
      --debug       Output debugging information
      --no-colour   Disable colour output
```

### SEE ALSO

* [rain](index.md)	 - 

###### Auto generated by spf13/cobra on 23-Apr-2026
