Skip to content

Upgrade aws-sdk v2 to @aws-sdk/client-s3 v3 #844

Merged
AnkitSegment merged 4 commits intomasterfrom
aws-upgrade
Mar 5, 2026
Merged

Upgrade aws-sdk v2 to @aws-sdk/client-s3 v3 #844
AnkitSegment merged 4 commits intomasterfrom
aws-upgrade

Conversation

@AnkitSegment
Copy link
Copy Markdown
Contributor

Summary

  • Migrate scripts/upload-assets.js from the monolithic aws-sdk v2 to the modular @aws-sdk/client-s3 v3 package
  • Reduces devDependency footprint by only installing the S3 client module instead of the entire AWS SDK
  • Pin to @aws-sdk/client-s3@3.722.0, the last version supporting the repo's Node 16 runtime

Changes

scripts/upload-assets.js

  • Replace require('aws-sdk/clients/s3') with const { S3Client, PutObjectCommand } = require('@aws-sdk/client-s3')
  • Use new S3Client({ region, credentials: { ... } }) instead of new S3({ accessKeyId, secretAccessKey, sessionToken, region })
  • Replace s3.putObject(params).promise() with s3.send(new PutObjectCommand(params)) throughout (putObject helper + 2 manifest uploads)

package.json

  • Replace "aws-sdk": "^2.760.0" with "@aws-sdk/client-s3": "3.722.0" in devDependencies

Test 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.

Screenshot 2026-02-13 at 2 44 35 PM

Test plan

  • node -c scripts/upload-assets.js — syntax check passes
  • SDK v3 imports and instantiation verified at runtime on Node 16.20.2
  • S3Client, PutObjectCommand, and client.send() all functional
  • yarn test passes (no integration tests affected — this is a build-only script)
  • All PutObjectCommand parameters (Bucket, Key, Body, ContentType, GrantRead, GrantFullControl, ContentEncoding, CacheControl) are identical between v2 and v3 APIs

🤖 Generated with Claude Code

Comment thread .buildkite/pipeline.yml Outdated
Comment thread scripts/upload-assets.js
Comment thread .buildkite/pipeline.yml Outdated
@AnkitSegment AnkitSegment merged commit d41432e into master Mar 5, 2026
5 of 7 checks passed
@AnkitSegment AnkitSegment deleted the aws-upgrade branch March 5, 2026 04:35
AnkitSegment added a commit that referenced this pull request Apr 16, 2026
AnkitSegment added a commit that referenced this pull request Apr 16, 2026
AnkitSegment added a commit that referenced this pull request Apr 17, 2026
commit 3e04f5f
Author: Ankit Gupta <ankit.gupta@segment.com>
Date:   Fri Apr 17 14:01:41 2026 +0530

    Update package version

commit a2b2265
Author: Ankit Gupta <ankit.gupta@segment.com>
Date:   Fri Apr 17 13:50:41 2026 +0530

    Updated dynamic sdk from static

commit 9257f39
Author: Aditya Gupta <97892100+adityagupta-7@users.noreply.github.com>
Date:   Thu Apr 16 13:57:44 2026 +0530

    fix (moengage): handled obj-case find method fuzzy traits method calling (#846)

    * fix: handled obj-case find method fuzzy traits method calling

    * fix: updated history md file

commit d41432e
Author: Ankit Gupta <139338151+AnkitSegment@users.noreply.github.com>
Date:   Thu Mar 5 10:05:00 2026 +0530

    Upgrade aws-sdk v2 to @aws-sdk/client-s3 v3  (#844)

    * Upgraded new aws version from v2 to v3

    * Removed git command from pipeline

    * updated upload-assets file

    * updated upload-assets file

commit 8019caa
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Wed Feb 11 15:28:33 2026 +0000

    Updating GTM tests (#841)

    * Updating GTM tests

    * updating tests

commit 81cf68d
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Tue Feb 10 06:31:10 2026 +0000

    Gtm bugfix2 (#840)

    * fixing bug for gtm custom domain

    * package bump

commit 5729cd6
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Mon Feb 2 07:59:15 2026 +0000

    Bump Google Tag Manager to v2.5.2 (#839)

    Version bump to deploy the fullURLpath changes from commit 78fd671. The previous commit modified code but didn't bump the version, causing the new code to overwrite cached 2.5.1 assets that have a 1-year immutable cache policy.

    Co-authored-by: Claude (us.anthropic.claude-sonnet-4-5-20250929-v1:0) <noreply@anthropic.com>

commit 78fd671
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Tue Jan 27 06:44:16 2026 +0000

    STRATCONN-6010 - [GTM - Classic] - full domain with file path (#838)

commit 503687d
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Mon Jan 26 07:44:07 2026 +0000

    STRATCONN-5638 - [GTM] - domain configuration support (#836)

commit b62fc34
Author: Arjun Bhandage <abhandage@twilio.com>
Date:   Tue Jan 20 16:48:01 2026 +0530

    (non-prod) STRATCONN-6104: fix the pipeline to run all tests on master and remove publish step (#834)

    * chore: specify yarn package manager version in package.json

    * test

    * test

    * fix: enhance CI pipeline with master-specific build and test steps, remove publish step

    * Apply suggestions from code review

    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

    * fix: correct argument order in test-master script for consistency

    * address comment

    ---------

    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

commit 8ea51e1
Author: VWO Integration <53477775+vwointegration@users.noreply.github.com>
Date:   Wed Sep 10 13:25:09 2025 +0530

    feat: add experiment name to VWO tracking data (#829)

    Co-authored-by: Rohit Tyagi <rohittyagi@WINDELLAP-1217.local>

commit 2470fd9
Author: Arjun Bhandage <abhandage@twilio.com>
Date:   Wed Jul 30 17:34:03 2025 +0530

    STRATCONN-5792: Remove vulnerable dependency from several destinations. (#828)

    * STRATCONN-5792: Remove vulnerable dependency from several destinations.

    * update

    * untouch other dependencies

commit adef8c3
Author: Ankit Gupta <139338151+AnkitSegment@users.noreply.github.com>
Date:   Wed Jul 16 12:14:04 2025 +0530

    Updated twitter ads version to 2.5.3 (#827)

commit 04cbb18
Author: Ankit Gupta <139338151+AnkitSegment@users.noreply.github.com>
Date:   Wed Jul 16 12:05:22 2025 +0530

    [Main] Update bing ads version 2.0.3 (#826)

    * Updated condition for undefined consentSettings

    * Update the version

commit af58163
Author: Ankit Gupta <139338151+AnkitSegment@users.noreply.github.com>
Date:   Wed Jul 16 11:55:41 2025 +0530

    Updated condition for undefined consentSettings (#825)

commit ec9a19d
Author: Arjun Bhandage <abhandage@twilio.com>
Date:   Thu Jul 10 14:56:34 2025 +0530

    STRATCONN-5950: Upgrade twitter-ads sdk (#824)

    * STRATCONN-5950: Upgrade twitter-ads sdk

    * update version

commit 8ab0178
Author: Ankit Gupta <139338151+AnkitSegment@users.noreply.github.com>
Date:   Wed Apr 30 19:11:59 2025 +0530

    [STRATCONN-5687] Added support for bing ads consent mode (#822)

    * Updated Bing ads consent

    * Updated Bing ads consent

    * Updated unit test cases and handle other cases

    * Updated unit test cases

    ---------

    Co-authored-by: Daniel Jackins <djackins@twilio.com>
    Co-authored-by: Harsh Joshi <harsh.joshi@segment.com>

commit 786b989
Author: Ankit Gupta <139338151+AnkitSegment@users.noreply.github.com>
Date:   Thu Apr 24 15:12:53 2025 +0530

    Revert "Added adStorage consent in bing ads (#819)" (#820)

    This reverts commit 5954107.

commit 5954107
Author: Ankit Gupta <139338151+AnkitSegment@users.noreply.github.com>
Date:   Tue Apr 22 16:07:07 2025 +0530

    Added adStorage consent in bing ads (#819)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants