fix(cli): failure to get credentials when session token is not set#32134
fix(cli): failure to get credentials when session token is not set#32134mergify[bot] merged 5 commits intomainfrom
Conversation
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32134 +/- ##
=======================================
Coverage 77.14% 77.15%
=======================================
Files 105 105
Lines 7163 7165 +2
Branches 1311 1312 +1
=======================================
+ Hits 5526 5528 +2
Misses 1457 1457
Partials 180 180
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Co-authored-by: Eli Polonsky <epolon@amazon.com>
| if (sessionToken) { | ||
| process.env.AWS_SESSION_TOKEN = sessionToken; | ||
| } |
There was a problem hiding this comment.
Why don't we do this inside the if that checks for id and key?
Why do we need to do this at all, anyway? Is it because AMAZON_ACCESS_KEY_ID is no longer supported, and it must be AWS_ACCESS_KEY_ID?
There was a problem hiding this comment.
Why don't we do this inside the if that checks for id and key?
Sure.
Why do we need to do this at all, anyway?
Because we want to keep it backward compatible and still support AMAZON_ACCESS_KEY_ID, but the SDK only reads from AWS_ACCESS_KEY_ID.
|
➡️ PR build request submitted to A maintainer must now check the pipeline and add the |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
In Node.js, if you assign
undefinedto an environment variable, that variable ends up having the string"undefined".If we are using IAM user credentials,
AWS_SESSION_TOKENshould not be set, but because we were not handling this edge case, it was getting assigned an invalid value:Closes #32120.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license