@@ -30,7 +30,6 @@ import { showMessageWithCancel } from '../utilities/messages'
3030import { ToolkitError , UnknownError } from '../errors'
3131import { SamCliError } from './cli/samCliInvokerUtils'
3232import fs from '../fs/fs'
33- import { asEnvironmentVariables } from '../../auth/credentials/utils'
3433import { getSpawnEnv } from '../env/resolveEnv'
3534
3635const localize = nls . loadMessageBundle ( )
@@ -290,7 +289,6 @@ export async function runLambdaFunction(
290289
291290 const envVars = await getSpawnEnv ( {
292291 ...process . env ,
293- ...( config . awsCredentials ? asEnvironmentVariables ( config . awsCredentials ) : { } ) ,
294292 ...( config . aws ?. region ? { AWS_DEFAULT_REGION : config . aws . region } : { } ) ,
295293 } )
296294
@@ -315,12 +313,13 @@ export async function runLambdaFunction(
315313
316314 // SAM CLI and any API requests are executed in parallel
317315 // A failure from either is a failure for the whole invocation
318- const [ processConst ] = await Promise . all ( [ invokeLambdaHandler ( timer , envVars , config , settings ) , apiRequest ] ) . catch (
319- ( err ) => {
320- timer . cancel ( )
321- throw err
322- }
323- )
316+ const [ processInvoker ] = await Promise . all ( [
317+ invokeLambdaHandler ( timer , envVars , config , settings ) ,
318+ apiRequest ,
319+ ] ) . catch ( ( err ) => {
320+ timer . cancel ( )
321+ throw err
322+ } )
324323
325324 if ( config . noDebug ) {
326325 return config
@@ -329,7 +328,7 @@ export async function runLambdaFunction(
329328 const terminationListener = vscode . debug . onDidTerminateDebugSession ( ( session ) => {
330329 const config = session . configuration as SamLaunchRequestArgs
331330 if ( config . invokeTarget ?. target === 'api' ) {
332- stopApi ( processConst , config )
331+ stopApi ( processInvoker , config )
333332 }
334333 } )
335334
0 commit comments