File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/core/runtime/src/create-stack Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ interface CheckStepInput {
1111 assumeRoleName ?: string ;
1212}
1313const sts = new STS ( ) ;
14+
15+ function sleep ( ms : number ) {
16+ return new Promise ( resolve => setTimeout ( resolve , ms ) ) ;
17+ }
18+
1419export const handler = async ( input : Partial < CheckStepInput > ) => {
1520 console . log ( `Verifying stack with parameters ${ JSON . stringify ( input , null , 2 ) } ` ) ;
1621
@@ -24,7 +29,16 @@ export const handler = async (input: Partial<CheckStepInput>) => {
2429 } else {
2530 cfn = new CloudFormation ( ) ;
2631 }
27- const stack = await cfn . describeStack ( stackName ! ) ;
32+ let stack ;
33+ let retries = 0 ;
34+ do {
35+ stack = await cfn . describeStack ( stackName ! ) ;
36+ if ( ! stack ) {
37+ console . log ( `Could not describe stack, retrying ${ retries + 1 } of 12 times` ) ;
38+ retries = retries + 1 ;
39+ await sleep ( 10000 ) ;
40+ }
41+ } while ( ! stack && retries < 12 ) ;
2842 if ( ! stack ) {
2943 return {
3044 status : 'FAILURE' ,
You can’t perform that action at this time.
0 commit comments