Skip to content

Commit

Permalink
wait for stack to exist if create fails due to stack already existing
Browse files Browse the repository at this point in the history
  • Loading branch information
cplee committed Oct 17, 2018
1 parent 181d51d commit 80b35f0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions provider/aws/cloudformation.go
Expand Up @@ -348,6 +348,14 @@ func (cfnMgr *cloudformationStackManager) UpsertStack(stackName string, template
return err
}
log.Debugf("Stack '%s' already existed, trying update instead.", stackName)
waitParams := &cloudformation.DescribeStacksInput{
StackName: aws.String(stackName),
}
log.Debug(" Waiting for stack to exist...")
err = cfnMgr.cfnAPI.WaitUntilStackExists(waitParams)
if err != nil {
return err
}
stack = cfnMgr.AwaitFinalStatus(stackName)
} else {
return nil
Expand Down

0 comments on commit 80b35f0

Please sign in to comment.