Skip to content

Commit

Permalink
Merge pull request #542 from ericzbeard/v-1-16-0
Browse files Browse the repository at this point in the history
Version 1.16.0
  • Loading branch information
ericzbeard authored Oct 3, 2024
2 parents 549b787 + 9905775 commit 359521d
Show file tree
Hide file tree
Showing 276 changed files with 12,039 additions and 4,800 deletions.
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,18 +242,19 @@ Resources:
TheS3URI: s3://rain-artifacts-755952356119-us-east-1/a84b588aa54068ed4b027b6e06e5e0bb283f83cf0d5a6720002d36af2225dfc3
```

If instead of providing a path to a file, you supply an object with properties, you can exercise more control over how the object is uploaded to S3. The following example is a common pattern for uploading Lambda function code.
If instead of providing a path to a file, you supply an object with properties, you can exercise more control over how the object is uploaded to S3. The following example is a common pattern for uploading Lambda function code. The optional `Run` property is a local script that you want Rain to run before uploading the content at `Path`.

```yaml
Resources:
MyFunction:
Type: AWS::Lambda::Function
Properties:
Code: !Rain::S3
Path: lambda-src
Path: lambda-dist
Zip: true
BucketProperty: S3Bucket
KeyProperty: S3Key
Run: buildscript.sh
```

The packaged template:
Expand All @@ -268,6 +269,42 @@ Resources:
S3Key: 1b4844dacc843f09941c11c94f80981d3be8ae7578952c71e875ef7add37b1a7
```

#### Metadata commands

You can add a metadata section to an `AWS::S3::Bucket` resource to take additional actions during deployment, such as running pre and post build scripts, uploading content to the bucket after stack deployment completes, and emptying the contents of the bucket when the stack is deleted.

```yaml
Resources:
Bucket:
Type: AWS::S3::Bucket
Metadata:
Rain:
EmptyOnDelete: true
Content: site/dist
Version: 2
DistributionLogicalId: SiteDistribution
RunBefore:
Command: buildsite.sh
Args:
- ALiteralArgument
RunAfter:
Command: buildsite.sh
Args:
- Rain::OutputValue AStackOutputKey
```

`EmptyOnDelete`: If true, the bucket's contents, including all versions, will be deleted so that the bucket itself can be deleted. This can be useful for development environments, but be careful about using it in production!

`Version`: Rain doesn't do anything with this, but incrementing the number can force the stack to deploy if there have been no infrastructure changes to the stack.

`RunBefore`: Rain will run this command before the stack deploys. Useful to run your website build script before bothering to deploy, to make sure it builds successfully.

`RunAfter`: Rain will run this command after deployment, and it is capable of doing stack output lookups to provide arguments to the script. This is useful if you deployed a resource like an API Gateway and need to know the stage URL to plug in to your website configuration. Use `Rain::OutputValue OutputKey` to pass one of the arguments to the script.

`DistributionLogicalId`: Supply the logical id of a CloudFront distribution to invalidate all files in it after the content upload completes.

See `test/webapp/README.md` for a complete example of using these commands with Rain modules.

#### Module

The `!Rain::Module` directive is an experimental feature that allows you to
Expand Down
41 changes: 39 additions & 2 deletions docs/README.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,19 @@ Resources:
TheS3URI: s3://rain-artifacts-755952356119-us-east-1/a84b588aa54068ed4b027b6e06e5e0bb283f83cf0d5a6720002d36af2225dfc3
```

If instead of providing a path to a file, you supply an object with properties, you can exercise more control over how the object is uploaded to S3. The following example is a common pattern for uploading Lambda function code.
If instead of providing a path to a file, you supply an object with properties, you can exercise more control over how the object is uploaded to S3. The following example is a common pattern for uploading Lambda function code. The optional `Run` property is a local script that you want Rain to run before uploading the content at `Path`.

```yaml
Resources:
MyFunction:
Type: AWS::Lambda::Function
Properties:
Code: !Rain::S3
Path: lambda-src
Path: lambda-dist
Zip: true
BucketProperty: S3Bucket
KeyProperty: S3Key
Run: buildscript.sh
```

The packaged template:
Expand All @@ -240,6 +241,42 @@ Resources:
S3Key: 1b4844dacc843f09941c11c94f80981d3be8ae7578952c71e875ef7add37b1a7
```

#### Metadata commands

You can add a metadata section to an `AWS::S3::Bucket` resource to take additional actions during deployment, such as running pre and post build scripts, uploading content to the bucket after stack deployment completes, and emptying the contents of the bucket when the stack is deleted.

```yaml
Resources:
Bucket:
Type: AWS::S3::Bucket
Metadata:
Rain:
EmptyOnDelete: true
Content: site/dist
Version: 2
DistributionLogicalId: SiteDistribution
RunBefore:
Command: buildsite.sh
Args:
- ALiteralArgument
RunAfter:
Command: buildsite.sh
Args:
- Rain::OutputValue AStackOutputKey
```

`EmptyOnDelete`: If true, the bucket's contents, including all versions, will be deleted so that the bucket itself can be deleted. This can be useful for development environments, but be careful about using it in production!

`Version`: Rain doesn't do anything with this, but incrementing the number can force the stack to deploy if there have been no infrastructure changes to the stack.

`RunBefore`: Rain will run this command before the stack deploys. Useful to run your website build script before bothering to deploy, to make sure it builds successfully.

`RunAfter`: Rain will run this command after deployment, and it is capable of doing stack output lookups to provide arguments to the script. This is useful if you deployed a resource like an API Gateway and need to know the stage URL to plug in to your website configuration. Use `Rain::OutputValue OutputKey` to pass one of the arguments to the script.

`DistributionLogicalId`: Supply the logical id of a CloudFront distribution to invalidate all files in it after the content upload completes.

See `test/webapp/README.md` for a complete example of using these commands with Rain modules.

#### Module

The `!Rain::Module` directive is an experimental feature that allows you to
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Rain is a command line tool for working with AWS CloudFormation templates and st
* [rain tree](rain_tree.md) - Find dependencies of Resources and Outputs in a local template
* [rain watch](rain_watch.md) - Display an updating view of a CloudFormation stack

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain bootstrap

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ rain build [<resource type>] or <prompt>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_cat.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ rain cat <stack>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_cc.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ You must pass the --experimental (-x) flag to use this command, to acknowledge t
* [rain cc rm](rain_cc_rm.md) - Delete a deployment created by cc deploy (Experimental!)
* [rain cc state](rain_cc_state.md) - Download the state file for a template deployed with cc deploy

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_cc_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ rain cc deploy <template> <name>

* [rain cc](rain_cc.md) - Interact with templates using Cloud Control API instead of CloudFormation

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_cc_drift.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ rain cc drift <name>

* [rain cc](rain_cc.md) - Interact with templates using Cloud Control API instead of CloudFormation

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_cc_rm.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ rain cc rm <name>

* [rain cc](rain_cc.md) - Interact with templates using Cloud Control API instead of CloudFormation

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_cc_state.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ rain cc state <name>

* [rain cc](rain_cc.md) - Interact with templates using Cloud Control API instead of CloudFormation

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_console.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ rain console [stack]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ rain deploy <template> [stack]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ rain diff <from> <to>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_fmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ rain fmt <filename>...

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_forecast.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ rain forecast --experimental <template> [stackName]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain info

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ rain logs <stack> (<resource>)

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_ls.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ rain ls <stack> [changeset]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain merge <template> <template> ...

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ The rain module command can be used to publish modules to CodeArtifact, and to i
* [rain module install](rain_module_install.md) - Install a package of Rain modules from CodeArtifact
* [rain module publish](rain_module_publish.md) - Publish a directory of Rain modules to CodeArtifact

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_module_bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ rain module bootstrap [flags]

* [rain module](rain_module.md) - Interact with Rain modules in CodeArtifact

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_module_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain module install <name> [flags]

* [rain module](rain_module.md) - Interact with Rain modules in CodeArtifact

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_module_publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain module publish <name> [flags]

* [rain module](rain_module.md) - Interact with Rain modules in CodeArtifact

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_pkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ rain pkg <template>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_rm.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ rain rm <stack> [changeset]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_stackset.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ This command manipulates stack sets. It has no action if specific stack set comm
* [rain stackset ls](rain_stackset_ls.md) - List a CloudFormation stack sets in a given region
* [rain stackset rm](rain_stackset_rm.md) - Delete a CloudFormation stack set and/or its instances.

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_stackset_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ rain stackset deploy <template> [stackset] [flags]

* [rain stackset](rain_stackset.md) - This command manipulates stack sets.

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_stackset_ls.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ rain stackset ls <stack set>

* [rain stackset](rain_stackset.md) - This command manipulates stack sets.

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_stackset_rm.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ rain stackset rm <stackset>

* [rain stackset](rain_stackset.md) - This command manipulates stack sets.

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain tree [template]

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
2 changes: 1 addition & 1 deletion docs/rain_watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ rain watch <stack>

* [rain](index.md) -

###### Auto generated by spf13/cobra on 2-Oct-2024
###### Auto generated by spf13/cobra on 3-Oct-2024
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ require (
github.com/aws/aws-sdk-go-v2 v1.31.0
github.com/aws/aws-sdk-go-v2/config v1.27.39
github.com/aws/aws-sdk-go-v2/credentials v1.17.37
github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.17.3
github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.18.0
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.54.3
github.com/aws/aws-sdk-go-v2/service/ec2 v1.179.2
github.com/aws/aws-sdk-go-v2/service/s3 v1.63.3
github.com/aws/aws-sdk-go-v2/service/s3 v1.64.0
github.com/aws/aws-sdk-go-v2/service/sts v1.31.3
github.com/aws/smithy-go v1.21.0
github.com/chzyer/readline v1.5.1
Expand All @@ -38,7 +38,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/kms v1.36.3
github.com/aws/aws-sdk-go-v2/service/lightsail v1.41.3
github.com/aws/aws-sdk-go-v2/service/rds v1.86.0
github.com/aws/aws-sdk-go-v2/service/sagemaker v1.161.1
github.com/aws/aws-sdk-go-v2/service/sagemaker v1.162.0
github.com/aws/aws-sdk-go-v2/service/servicequotas v1.24.3
github.com/aws/aws-sdk-go-v2/service/ssm v1.54.3
github.com/fatih/color v1.17.0
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.15.1 h1:Xb5d44UWp+oHJMu6A
github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.15.1/go.mod h1:uI45a6i3xUAkx/xFegQ1SNnClz9OrfOixs96ZH4rca8=
github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.17.3 h1:PtP2Zzf3uy94EsVOW+tB7gNt63fFZEHuS9IRWg5q250=
github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.17.3/go.mod h1:4zuvYEUJm0Vq8tb3gcb2sl04A9I1AA5DKAefbYPA4VM=
github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.18.0 h1:g0vI1Fzpk9Rtqj6waXkbbRSYj//Ney9q4zid79+Upvk=
github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.18.0/go.mod h1:4zuvYEUJm0Vq8tb3gcb2sl04A9I1AA5DKAefbYPA4VM=
github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.18.9 h1:Wp1QFv8uyNpwPXSI/a6TRkIR0CiT+Fa60s5vVTsFdXM=
github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.18.9/go.mod h1:pFrHzOZRN/EfWL7ygk9ELdQHqRGERgOgP03OLIOlQV4=
github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.19.1 h1:xje03QCAf/8b1Ntsx/QR4oTn0tMIshVT/OUAilcwcO0=
Expand Down Expand Up @@ -272,6 +274,8 @@ github.com/aws/aws-sdk-go-v2/service/s3 v1.60.0 h1:2QXGJvG19QwqXUvgcdoCOZPyLuvZf
github.com/aws/aws-sdk-go-v2/service/s3 v1.60.0/go.mod h1:BSPI0EfnYUuNHPS0uqIo5VrRwzie+Fp+YhQOUs16sKI=
github.com/aws/aws-sdk-go-v2/service/s3 v1.63.3 h1:3zt8qqznMuAZWDTDpcwv9Xr11M/lVj2FsRR7oYBt0OA=
github.com/aws/aws-sdk-go-v2/service/s3 v1.63.3/go.mod h1:NLTqRLe3pUNu3nTEHI6XlHLKYmc8fbHUdMxAB6+s41Q=
github.com/aws/aws-sdk-go-v2/service/s3 v1.64.0 h1:I0p8knB/IDYSQ3dbanaCr4UhiYQ96bvKRhGYxvLyiD8=
github.com/aws/aws-sdk-go-v2/service/s3 v1.64.0/go.mod h1:NLTqRLe3pUNu3nTEHI6XlHLKYmc8fbHUdMxAB6+s41Q=
github.com/aws/aws-sdk-go-v2/service/sagemaker v1.151.0 h1:zH7b/d8vOrOWdgluKEux2TAECYKhprH2eMztkpak/mI=
github.com/aws/aws-sdk-go-v2/service/sagemaker v1.151.0/go.mod h1:lDmK3DHWV6Y6hpzeUAaXq4w+ks6fFYXdkjavIe8STCE=
github.com/aws/aws-sdk-go-v2/service/sagemaker v1.152.0 h1:y3jRrFbGve0omxt5gDStki51bjYJ6gxhtXr7VFagVv4=
Expand All @@ -280,6 +284,8 @@ github.com/aws/aws-sdk-go-v2/service/sagemaker v1.154.0 h1:NDEbY45I7YFiSAW055YdE
github.com/aws/aws-sdk-go-v2/service/sagemaker v1.154.0/go.mod h1:tn9CZCzeX7NC+qhWtnsN7GUzXG64/QUqjxeZZetzjpo=
github.com/aws/aws-sdk-go-v2/service/sagemaker v1.161.1 h1:YS9lbicBMTMFNH2IczY0KvsukyWvvcEjos8sk/VPLQY=
github.com/aws/aws-sdk-go-v2/service/sagemaker v1.161.1/go.mod h1:Tbr4Z2D/vjAaeWeAlwKLUTwEabATR12YTXcW9HFoSpA=
github.com/aws/aws-sdk-go-v2/service/sagemaker v1.162.0 h1:Ip2efAn1od3MoT9Cjkh+bU/Nxe7K3V6RW0VMjTg8tw4=
github.com/aws/aws-sdk-go-v2/service/sagemaker v1.162.0/go.mod h1:Tbr4Z2D/vjAaeWeAlwKLUTwEabATR12YTXcW9HFoSpA=
github.com/aws/aws-sdk-go-v2/service/servicequotas v1.21.9 h1:3o5zcwZYvte3CeaYpLaWafwCSkJpclPXI5KSH+lXB90=
github.com/aws/aws-sdk-go-v2/service/servicequotas v1.21.9/go.mod h1:QZpGkzlec0TPr8CA2Td5zRUJBC5+104ib0MusH5UVfI=
github.com/aws/aws-sdk-go-v2/service/servicequotas v1.22.1 h1:QsHvqtdy0mGzpg/A+1lZX1ilf05Vuh2rSBzNJ3f3T1I=
Expand Down
Loading

0 comments on commit 359521d

Please sign in to comment.