aws-cost-cli icon indicating copy to clipboard operation
aws-cost-cli copied to clipboard

Upgrade to AWS SDK v3 and latest dependencies

Open Copilot opened this issue 8 months ago โ€ข 0 comments

This PR upgrades the project from AWS SDK v2 to v3 and updates all dependencies to their latest versions, addressing security vulnerabilities and improving performance.

๐Ÿš€ Key Changes

AWS SDK Migration (v2 โ†’ v3)

  • Replaced monolithic [email protected] with modular v3 clients:
  • Updated all AWS service calls to use the new command pattern:
    // Before (v2)
    const iam = new AWS.IAM(awsConfig);
    const result = await iam.listAccountAliases().promise();
    
    // After (v3)
    const iam = new IAMClient(awsConfig);
    const result = await iam.send(new ListAccountAliasesCommand({}));
    

Dependency Updates

Code Improvements

  • Removed AWS SDK v2 maintenance mode suppression (no longer needed)
  • Enhanced error handling with proper null safety for Cost Explorer responses
  • Updated configuration types for better AWS SDK v3 compatibility
  • Migrated to @smithy/[email protected] (replacing deprecated package)

Security & Performance

  • โœ… Fixed 2 moderate security vulnerabilities from outdated dependencies
  • โœ… Zero vulnerabilities after upgrade (verified with npm audit)
  • ๐Ÿš€ Improved bundle size through modular AWS SDK approach
  • ๐Ÿ“ฆ Maintained same functionality with modern, actively maintained packages

๐Ÿงช Testing

  • โœ… All TypeScript compilation passes
  • โœ… Build process successful
  • โœ… CLI help and version commands working
  • โœ… Error handling functional (tested credential validation)
  • โœ… Package contents verified for npm publishing

The CLI maintains full backward compatibility while now using the latest AWS SDK v3 architecture for better performance and security.


๐Ÿ’ก You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Aug 20 '25 12:08 Copilot