feat: add version-aware AWS CLI guidance to credential error messages#452
Open
siwachabhi wants to merge 1 commit intoaws:mainfrom
Open
feat: add version-aware AWS CLI guidance to credential error messages#452siwachabhi wants to merge 1 commit intoaws:mainfrom
siwachabhi wants to merge 1 commit intoaws:mainfrom
Conversation
d7b4f37 to
fd201a2
Compare
fd201a2 to
9655e0a
Compare
notgitika
requested changes
Feb 25, 2026
| let errorMessage: string; | ||
| if (isNoCredentialsError(error)) { | ||
| errorMessage = 'AWS credentials not found. Run `aws sso login` or set AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY.'; | ||
| errorMessage = 'AWS credentials not found. Run `aws login` to authenticate.'; |
Contributor
There was a problem hiding this comment.
This should also use getAwsLoginGuidance() for consistency, right? The function is already async, so it could just be:
errorMessage = `AWS credentials not found. ${await getAwsLoginGuidance()}`;
Credential error messages now include contextual AWS CLI guidance instead of hardcoded "Run: aws login" strings. When the CLI is missing or below v2.32.0, users see install/upgrade instructions inline — the overall message structure stays the same. Also updates stale "aws sso login" reference to "aws login" in pre-deploy identity flow.
9655e0a to
f95fe46
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
aws loginstringsaws login), users see install/upgrade instructions with a link to the official docsaws sso loginreference toaws loginin the pre-deploy identity flowChanges
src/cli/external-requirements/versions.tsAWS_CLI_MIN_VERSION(2.32.0) constantsrc/cli/external-requirements/checks.tscheckAwsCliVersion(),getAwsLoginGuidance()(cached), andparseAwsCliVersion()— follows existingcheckNodeVersionpatternsrc/cli/external-requirements/index.tssrc/cli/aws/account.ts'Run: aws login'strings with dynamicawait getAwsLoginGuidance()src/cli/operations/deploy/pre-deploy-identity.ts'aws sso login'→'aws login'Motivation
Users with older AWS CLI versions (< 2.32.0) see
Run: aws loginin error messages, butaws logindoesn't exist in their version. This leads to confusion — they try the command, it fails, and they don't know why. The new guidance detects the installed CLI version and tells users exactly what to do:Test plan
checks.test.ts,versions.test.ts,detect.test.ts,account.test.ts,pre-deploy-identity.test.tspassnpx tsc --noEmitpassesagentcore deploywith expired creds and verify guidance message