in service/cloudformation/api_op_DescribeStacks.go [348:660]
func stackCreateCompleteStateRetryable(ctx context.Context, input *DescribeStacksInput, output *DescribeStacksOutput, err error) (bool, error) {
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "CREATE_COMPLETE"
match := len(v2) > 0
for _, v := range v2 {
if string(v) != expectedValue {
match = false
break
}
}
if match {
return false, nil
}
}
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "UPDATE_COMPLETE"
match := len(v2) > 0
for _, v := range v2 {
if string(v) != expectedValue {
match = false
break
}
}
if match {
return false, nil
}
}
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "UPDATE_IN_PROGRESS"
match := len(v2) > 0
for _, v := range v2 {
if string(v) != expectedValue {
match = false
break
}
}
if match {
return false, nil
}
}
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS"
match := len(v2) > 0
for _, v := range v2 {
if string(v) != expectedValue {
match = false
break
}
}
if match {
return false, nil
}
}
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "UPDATE_FAILED"
match := len(v2) > 0
for _, v := range v2 {
if string(v) != expectedValue {
match = false
break
}
}
if match {
return false, nil
}
}
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "UPDATE_ROLLBACK_IN_PROGRESS"
match := len(v2) > 0
for _, v := range v2 {
if string(v) != expectedValue {
match = false
break
}
}
if match {
return false, nil
}
}
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "UPDATE_ROLLBACK_FAILED"
match := len(v2) > 0
for _, v := range v2 {
if string(v) != expectedValue {
match = false
break
}
}
if match {
return false, nil
}
}
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS"
match := len(v2) > 0
for _, v := range v2 {
if string(v) != expectedValue {
match = false
break
}
}
if match {
return false, nil
}
}
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "UPDATE_ROLLBACK_COMPLETE"
match := len(v2) > 0
for _, v := range v2 {
if string(v) != expectedValue {
match = false
break
}
}
if match {
return false, nil
}
}
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "CREATE_FAILED"
var match bool
for _, v := range v2 {
if string(v) == expectedValue {
match = true
break
}
}
if match {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "DELETE_COMPLETE"
var match bool
for _, v := range v2 {
if string(v) == expectedValue {
match = true
break
}
}
if match {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "DELETE_FAILED"
var match bool
for _, v := range v2 {
if string(v) == expectedValue {
match = true
break
}
}
if match {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "ROLLBACK_FAILED"
var match bool
for _, v := range v2 {
if string(v) == expectedValue {
match = true
break
}
}
if match {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
v1 := output.Stacks
var v2 []types.StackStatus
for _, v := range v1 {
v3 := v.StackStatus
v2 = append(v2, v3)
}
expectedValue := "ROLLBACK_COMPLETE"
var match bool
for _, v := range v2 {
if string(v) == expectedValue {
match = true
break
}
}
if match {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err != nil {
var apiErr smithy.APIError
ok := errors.As(err, &apiErr)
if !ok {
return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err)
}
if "ValidationError" == apiErr.ErrorCode() {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err != nil {
return false, err
}
return true, nil
}