Skip to content

Instantly share code, notes, and snippets.

@MadVikingGod
Created February 22, 2019 20:28
Show Gist options
  • Save MadVikingGod/76329f8c4b0eef90b280b59efaf5e81f to your computer and use it in GitHub Desktop.
Save MadVikingGod/76329f8c4b0eef90b280b59efaf5e81f to your computer and use it in GitHub Desktop.
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