@@ -47,7 +47,7 @@ const timer = new Date().getTime();
4747let certData , endpoint , stack , functions , template ;
4848const policyName = "lambda-debug-policy" ;
4949
50- const packageVersion = JSON . parse ( fs . readFileSync ( path . join ( __dirname , '..' , '..' , '..' , '..' , 'package.json' ) ) ) . version ;
50+ const packageVersion = JSON . parse ( fs . readFileSync ( path . join ( __dirname , '..' , '..' , '..' , '..' , 'package.json' ) ) ) . version ;
5151
5252const zipFilePath = path . join ( os . homedir ( ) , '.lambda-debug' , `relay-${ accountId } -${ packageVersion } .zip` ) ;
5353
@@ -144,8 +144,15 @@ if (!fs.existsSync(".lambda-debug")) {
144144 const stackName = envConfig . stack_name ;
145145
146146 template = yamlParse ( fs . readFileSync ( findSAMTemplateFile ( '.' ) ) . toString ( ) ) ;
147-
148147 stack = await cfnClient . send ( new ListStackResourcesCommand ( { StackName : stackName } ) ) ;
148+ let token = stack . NextToken ;
149+ if ( token ) {
150+ do {
151+ const page = await cfnClient . send ( new ListStackResourcesCommand ( { StackName : stackName , NextToken : token } ) ) ;
152+ stack . StackResourceSummaries = stack . StackResourceSummaries . concat ( page . StackResourceSummaries ) ;
153+ token = page . NextToken ;
154+ } while ( token ) ;
155+ }
149156
150157 functions = Object . keys ( template . Resources ) . filter ( key => template . Resources [ key ] . Type === 'AWS::Serverless::Function' ) ;
151158 if ( process . env . includeFunctions ) {
@@ -173,7 +180,7 @@ if (!fs.existsSync(".lambda-debug")) {
173180 console . log ( `Error installing npm packages in relay folder: ${ npmInstall . error } ` ) ;
174181 process . exit ( 1 ) ;
175182 }
176-
183+
177184 //create zip file of relay folder
178185 const output = fs . createWriteStream ( zipFilePath ) ;
179186 const archive = archiver ( 'zip' , {
@@ -276,7 +283,7 @@ client.on('connect', async function () {
276283
277284client . on ( 'message' , async function ( topic , message ) {
278285 const obj = JSON . parse ( message . toString ( ) ) ;
279- process . env = { ...obj . envVars , LOCAL_DEBUG : true } ;
286+ process . env = { ...obj . envVars , LOCAL_DEBUG : true } ;
280287 const result = await routeEvent ( obj . event , obj . context , stack , functionSources ) ;
281288 client . publish ( `lambda-debug/callback/${ mac } /${ obj . sessionId } ` , JSON . stringify ( result || { } ) ) ;
282289} ) ;
0 commit comments