-
Notifications
You must be signed in to change notification settings - Fork 1k
apigw-lambda-sfn-transcribe-translate-polly-sam: Update runtime to nodejs22.x #2842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
apigw-lambda-sfn-transcribe-translate-polly-sam: Update runtime to nodejs22.x #2842
Conversation
… nodejs22.x runtime
await apig | ||
.postToConnection({ | ||
let response = await stepfunctions.send(new StartSyncExecutionCommand(params)); | ||
await apig.send(new PostToConnectionCommand({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Some error occurs. Because in Node.js 18 and later runtimes, AWS SDK v3 is bundled, so I rewrote it to v3. See articles below.
const { ApiGatewayManagementApiClient, PostToConnectionCommand } = require('@aws-sdk/client-apigatewaymanagementapi'); | ||
const stepfunctions = new SFNClient({}); | ||
const apig = new ApiGatewayManagementApiClient({ | ||
endpoint: `https://${process.env.APIG_ENDPOINT}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Some error occurs. Because we need use connections
url with https.
< {"message": "Internal server error", "connectionId":"R-c1lc6StjMCFug=", "requestId":"R-d65GZntjMECaQ="}
const AWS = require('aws-sdk'); | ||
const s3 = new AWS.S3(); | ||
const polly = new AWS.Polly(); | ||
const uuidv1 = require('uuidv1'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Some error occurs.
{
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module 'uuidv1'\nRequire stack:\n- /var/task/src/speech.js\n- /var/runtime/index.mjs",
"trace": [
"Runtime.ImportModuleError: Error: Cannot find module 'uuidv1'",
"Require stack:",
"- /var/task/src/speech.js",
"- /var/runtime/index.mjs",
" at _loadUserApp (file:///var/runtime/index.mjs:1192:17)",
" at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1235:21)",
" at async start (file:///var/runtime/index.mjs:1454:23)",
" at async file:///var/runtime/index.mjs:1464:1"
]
}
Issue #, if available:
N/A
Description of changes:
Hi😀 Thanks for the useful patterns!
To prevent future deployment issues, I updated the deprecated Lambda Node.js runtime nodejs16.x to nodejs22.x.
See https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
Check
Thank you😀
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.