Skip to content

Commit

Permalink
adjusted Capabilities properties to only be added when needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaun committed Feb 26, 2017
1 parent 127a44a commit 173a408
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cloudformation.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,18 @@ func (s *stack) deploy(session *session.Session) error {
Log(fmt.Sprintf("Updated Template:\n%s", s.template), level.debug)

svc := cloudformation.New(session)
capability := "CAPABILITY_IAM"

createParams := &cloudformation.CreateStackInput{
StackName: aws.String(s.stackname),
DisableRollback: aws.Bool(true), // no rollback by default
TemplateBody: aws.String(s.template),
Capabilities: []*string{&capability},
}

// If IAM is bening touched, add Capabilities
if strings.Contains(s.template, "AWS::IAM") {
createParams.Capabilities = []*string{
aws.String(cloudformation.CapabilityCapabilityIam),
}
}

Log(fmt.Sprintln("Calling [CreateStack] with parameters:", createParams), level.debug)
Expand Down

0 comments on commit 173a408

Please sign in to comment.