Skip to content

Commit

Permalink
fix: update logging
Browse files Browse the repository at this point in the history
  • Loading branch information
sshelomentsev committed Feb 26, 2024
1 parent 0bb22ce commit 07664bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mgmt-lambda/handlers/updateHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,16 @@ async function updateCloudFrontConfig(
}

async function updateLambdaFunctionCode(lambdaClient: LambdaClient, functionName: string): Promise<string> {
console.info('Preparing command to update function code')
const command = new UpdateFunctionCodeCommand({
S3Bucket: defaults.LAMBDA_DISTRIBUTION_BUCKET,
S3Key: defaults.LAMBDA_DISTRIBUTION_BUCKET_KEY,
FunctionName: functionName,
Publish: true,
})
console.info('Sending update command to Lambda runtime')
const result = await lambdaClient.send(command)
console.info(`function arn = ${result.FunctionArn}`)
console.info(`function version = ${result.Version}`)
console.info(`Got Lambda function update result, functionARN: ${result.FunctionArn}`)

if (!result.FunctionArn) {
throw new Error('Function ARN not found after update')
Expand Down

0 comments on commit 07664bc

Please sign in to comment.