Skip to content

Commit

Permalink
Exit with an error on stack update roll back
Browse files Browse the repository at this point in the history
  • Loading branch information
artyom committed Dec 9, 2024
1 parent 171e44f commit b63ad54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ func run(ctx context.Context, stackName string, args []string) error {
debugf("%s\t%s\t%v", aws.ToString(evt.ResourceType), aws.ToString(evt.LogicalResourceId), evt.ResourceStatus)
if aws.ToString(evt.LogicalResourceId) == stackName && aws.ToString(evt.ResourceType) == "AWS::CloudFormation::Stack" {
switch evt.ResourceStatus {
case types.ResourceStatusUpdateRollbackComplete,
types.ResourceStatusRollbackFailed:
return fmt.Errorf("%v, see AWS CloudFormation Console for more details", evt.ResourceStatus)
case types.ResourceStatusUpdateComplete:
return nil
}
Expand Down

0 comments on commit b63ad54

Please sign in to comment.