aws-cost-cli
aws-cost-cli copied to clipboard
Upgrade to AWS SDK v3 and latest dependencies
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:-
@aws-sdk/[email protected]for IAM operations -
@aws-sdk/[email protected]for STS operations -
@aws-sdk/[email protected]for Cost Explorer operations
-
-
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
-
[email protected]โ14.0.0(latest CLI framework) -
[email protected]โ5.6.0(terminal styling) -
[email protected]โ1.11.13(date manipulation) -
[email protected]โ8.2.0(loading spinners) -
[email protected]โ5.9.2(TypeScript compiler) -
[email protected]โ8.5.0(bundler) -
@types/[email protected]โ24.3.0(Node.js types)
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.