Skip to content

Commit

Permalink
delete empty changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
snowiow committed Jun 12, 2024
1 parent 4a02f35 commit 290914a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cloudformation.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,15 @@ func (c *Cloudformation) CloudFormationDeploy(templateBody string, namedIAM bool
}

if changeSetIsEmpty(dcso) {
c.logger().Infof("ChangeSet '%v' is empty. Nothing to do.", *ccso.Id)
c.logger().Infof("ChangeSet '%v' is empty. Deleting again.", *ccso.Id)

_, err3 := c.CFClient.DeleteChangeSet(&cloudformation.DeleteChangeSetInput{
ChangeSetName: aws.String(csn),
StackName: aws.String(sn),
})
if err3 != nil {
return fmt.Errorf("couldn't delete empty change set: %w", err3)
}

return nil
}
Expand Down

0 comments on commit 290914a

Please sign in to comment.