Skip to content

Commit e303a7b

Browse files
authored
Merge pull request #593 from Scribbd/main
Fix s3bucket option for stackset deploy
2 parents f020e02 + 6aa7228 commit e303a7b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

internal/cmd/rain/rain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func init() {
9191
addCommand(stackGroup, true, false, ls.Cmd)
9292
addCommand(stackGroup, true, false, rm.Cmd)
9393
addCommand(stackGroup, true, false, watch.Cmd)
94-
addCommand(stackGroup, true, true, stackset.StackSetCmd)
94+
addCommand(stackGroup, true, false, stackset.StackSetCmd)
9595

9696
// Template commands
9797
addCommand(templateGroup, true, true, bootstrap.Cmd)

internal/cmd/stackset/stackset.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package stackset
22

33
import (
4+
"github.com/aws-cloudformation/rain/internal/aws/s3"
45
"github.com/aws-cloudformation/rain/internal/config"
56
"github.com/aws-cloudformation/rain/internal/console"
67
"github.com/spf13/cobra"
@@ -33,11 +34,16 @@ Use "{{.CommandPath}} [command] --help" for more information about a command.{{e
3334
var delegatedAdmin bool
3435

3536
// addCommand adds a command to the root command.
36-
func addCommand(profileOptions bool, c *cobra.Command) {
37+
func addCommand(profileOptions bool, bucketOptions bool, c *cobra.Command) {
3738
if profileOptions {
3839
c.Flags().StringVarP(&config.Profile, "profile", "p", "", "AWS profile name; read from the AWS CLI configuration file")
3940
c.Flags().StringVarP(&config.Region, "region", "r", "", "AWS region to use")
4041
}
42+
if bucketOptions {
43+
c.Flags().StringVar(&s3.BucketName, "s3-bucket", "", "Name of the S3 bucket that is used to upload assets")
44+
c.Flags().StringVar(&s3.BucketKeyPrefix, "s3-prefix", "", "Prefix to add to objects uploaded to S3 bucket")
45+
c.Flags().StringVar(&s3.ExpectedBucketOwner, "s3-owner", "", "The account where S3 assets are stored")
46+
}
4147

4248
c.Flags().BoolVar(&delegatedAdmin, "admin", false, "Use delegated admin permissions")
4349

@@ -51,9 +57,9 @@ var StackSetCmd = &cobra.Command{
5157
}
5258

5359
func init() {
54-
addCommand(true, LsCmd)
55-
addCommand(true, DeployCmd)
56-
addCommand(true, RmCmd)
60+
addCommand(true, false, LsCmd)
61+
addCommand(true, true, DeployCmd)
62+
addCommand(true, false, RmCmd)
5763

5864
oldUsageFunc := StackSetCmd.UsageFunc()
5965
StackSetCmd.SetUsageFunc(func(c *cobra.Command) error {

0 commit comments

Comments
 (0)