Upgrade runtime to Node 22 and AWS SDK v3#2
Open
Valamorde wants to merge 1 commit into
Open
Conversation
Runtime: NODEJS_12_X → NODEJS_22_X across all 5 Lambda functions.
SDK swap (all handlers):
- DynamoDB: AWS.DynamoDB.DocumentClient → DynamoDBDocumentClient.from(new DynamoDBClient())
- All .promise() calls → ddb.send(new XxxCommand())
- ApiGateway: AWS.ApiGatewayManagementApi → ApiGatewayManagementApiClient
- Endpoint now requires https:// prefix (SDK v3 requirement)
- Stale connection check: e.statusCode 410 → e.$metadata.httpStatusCode / e.name GoneException
Folded in zero-risk fixes while touching every line:
- onconnect: fix objectid/objectId implicit global (ReferenceError in strict mode)
- abovevttServices: remove dead getAllData() (referenced this.documentClient, never called)
- abovevttServices/sendmessage: remove dead require('http') and PRIORITY_ABOVE_NORMAL imports
- abovevttServices/migrate: fix for(tokenid) → for(const tokenid), batch slice(i,i+21) → slice(i,i+25)
- All handlers: replace hardcoded "abovevtt" table name with process.env.TABLE_NAME
- sendmessage: extract makeApigw() helper, remove unused apigwManagementApi in delete_scene/update_scene
cdk synth verified: all 5 runtimes nodejs22.x, table logical ID and DeletionPolicy unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NODEJS_12_XtoNODEJS_22_Xaws-sdkv2 with the modular AWS SDK v3 (@aws-sdk/client-dynamodb,@aws-sdk/lib-dynamodb,@aws-sdk/client-apigatewaymanagementapi).promise()chaining toclient.send(new XxxCommand(...))ApiGatewayManagementApitoApiGatewayManagementApiClient+PostToConnectionCommandNotes
No logic changes — this is a pure runtime and SDK upgrade. Each Lambda function retains its existing structure; only the AWS client instantiation and call patterns change.
Test plan