Created
February 22, 2019 20:28
-
-
Save MadVikingGod/76329f8c4b0eef90b280b59efaf5e81f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var CompleteStatuses = []string{ | |
cloudformation.StackStatusCreateComplete, | |
cloudformation.StackStatusUpdateComplete, | |
cloudformation.StackStatusDeleteComplete, | |
} | |
var FailedStatuses = []string{ | |
cloudformation.StackStatusCreateFailed, | |
cloudformation.StackStatusRollbackComplete, | |
cloudformation.StackStatusRollbackFailed, | |
cloudformation.StackStatusUpdateRollbackFailed, | |
cloudformation.StackStatusUpdateRollbackComplete, | |
cloudformation.StackStatusDeleteFailed, | |
} | |
var PendingStatuses = []string{ | |
cloudformation.StackStatusCreateInProgress, | |
cloudformation.StackStatusDeleteInProgress, | |
cloudformation.StackStatusRollbackInProgress, | |
cloudformation.StackStatusUpdateCompleteCleanupInProgress, | |
cloudformation.StackStatusUpdateInProgress, | |
cloudformation.StackStatusUpdateRollbackCompleteCleanupInProgress, | |
cloudformation.StackStatusUpdateRollbackInProgress, | |
cloudformation.StackStatusReviewInProgress, | |
} | |
func IsFailed(status string) bool { | |
for _, s := range FailedStatuses { | |
if s == status { | |
return true | |
} | |
} | |
return false | |
} | |
func IsComplete(status string) bool { | |
for _, s := range CompleteStatuses { | |
if s == status { | |
return true | |
} | |
} | |
return false | |
} | |
func IsPending(status string) bool { | |
for _, s := range PendingStatuses { | |
if s == status { | |
return true | |
} | |
} | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment