feat: Add AWS SSO credential support for SDK v3 (Claude-assisted) #88
+457
−13
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
This PR adds support for AWS SSO (Single Sign-On) credentials when using AWS SDK v3 mode. Users can now authenticate using
aws sso login
and deploy their serverless applications using SSO profiles.Fixes #87
What Changed
Core Features
fromNodeProviderChain
from@aws-sdk/credential-providers
Bug Fixes (discovered during implementation)
describeChangeSet
to SDK v3 command mappingsContents
property for empty bucketsFiles Modified
/lib/plugins/aws/provider.js
fromNodeProviderChain
_getActiveProfile()
method to determine active AWS profile_getV3BaseConfig()
to use credential providers instead of static credentialsgetCredentials()
for v3 SDK mode with SSO support_requestV3()
with SSO-specific error messages/lib/aws/commands.js
DescribeChangeSetCommand
import and mapping/lib/plugins/aws/deploy/lib/check-for-changes.js
/lib/plugins/aws/utils/find-and-group-deployments.js
/lib/plugins/aws/remove/lib/bucket.js
/docs/guides/credentials.md
/test/unit/lib/plugins/aws/provider.test.js
How to Test
Enable SDK v3 mode (required for SSO support):
export SLS_AWS_SDK_V3=1
Login with AWS SSO:
Deploy using SSO profile:
Testing Checklist
npm run lint
)Breaking Changes
None. This feature is only active when
SLS_AWS_SDK_V3=1
is set. Existing credential methods continue to work as before.Documentation
Updated
/docs/guides/credentials.md
with:Important Notes
SLS_AWS_SDK_V3=1
environment variable)~/.aws/config
Performance Impact
Minimal. The credential provider chain only resolves credentials when needed and caches them appropriately.
Security Considerations
Future Enhancements
Consider making SDK v3 the default mode in a future major release to enable SSO support by default.
NOTE: Claude by Anthropic assisted in the development of this code.