Upgrade aws-sdk v2 to @aws-sdk/client-s3 v3 #844
Open
AnkitSegment wants to merge 1 commit intomasterfrom
Open
Conversation
mdkhan-tw
reviewed
Feb 13, 2026
| agents: | ||
| queue: v1 | ||
| command: | ||
| - apt-get update && apt-get install -y git |
There was a problem hiding this comment.
Why do we need to make these changes as part of the PR
Contributor
Author
There was a problem hiding this comment.
AWS-SDK: 3.XX needs node 20 or above, so the buildkite pipeline gets broken.
Contributor
There was a problem hiding this comment.
Pls help me understand - why is git required here?
mdkhan-tw
reviewed
Feb 13, 2026
| } | ||
|
|
||
| return s3.putObject(options).promise(); | ||
| return s3.send(new PutObjectCommand(options)); |
Contributor
There was a problem hiding this comment.
passing back a promise as is from an async function is acceptable as long as the parent function is awaited and you don't want to handle any error scenarios for the promise.
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
scripts/upload-assets.jsfrom the monolithicaws-sdkv2 to the modular@aws-sdk/client-s3v3 package@aws-sdk/client-s3@3.722.0, the last version supporting the repo's Node 16 runtimeChanges
scripts/upload-assets.jsrequire('aws-sdk/clients/s3')withconst { S3Client, PutObjectCommand } = require('@aws-sdk/client-s3')new S3Client({ region, credentials: { ... } })instead ofnew S3({ accessKeyId, secretAccessKey, sessionToken, region })s3.putObject(params).promise()withs3.send(new PutObjectCommand(params))throughout (putObject helper + 2 manifest uploads)package.json"aws-sdk": "^2.760.0"with"@aws-sdk/client-s3": "3.722.0"in devDependenciesTest Screenshot
The uploadAssets function is used by makefile, when it calls new version of build get uploaded in s3.
Staging commit hash SHA: 532ade6
CDN link: https://cdn.segment.build/next-integrations/manifest-532ade6.json
S3 file update.
Test plan
node -c scripts/upload-assets.js— syntax check passesS3Client,PutObjectCommand, andclient.send()all functionalyarn testpasses (no integration tests affected — this is a build-only script)Bucket,Key,Body,ContentType,GrantRead,GrantFullControl,ContentEncoding,CacheControl) are identical between v2 and v3 APIs🤖 Generated with Claude Code