Repository navigation
Conversation
If no profile is selected and no region is found, the error now reports the missing profile first, because a profile can give the region. If the default profile fails and other profiles exist, the error tells the user to pass --profile or set AWS_PROFILE, and it lists the profiles. If a profile uses aws login, the error tells the user to run aws login. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ands The error names aws login only if the SDK asks the user to authenticate again. Other aws login errors point to aws sts get-caller-identity. The errors now show export commands for AWS_REGION, AWS_PROFILE, and the access keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The advice depended on the text of SDK errors. Without it, the error tells the user to run aws sts get-caller-identity, which names aws login. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The credentials and region errors now give the fixes in one sentence, easiest first, with OR between them. The profile list shows the account and role of each profile, and names aws configure list-profiles when it does not show all of them. A profile that is not in the AWS files now gets this error, not the SDK load error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new profile from aws configure sso --profile <name> is not selected, so the next run fails again. The SDK uses the default profile with no flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 3 tasks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Requirements
Related issues
None.
Describe the solution you've provided
aws sso login --profile <name>does not select a profile for later commands. If a user does not pass--profiletoldcli aws-devops-agent setup, the SDK uses the default profile. The old errors did not always tell the user about--profile, and they did not show which profiles exist.This PR changes the errors from
NewClients:ORbetween them: pass--profile, then runexport AWS_PROFILE=<name>, then add a profile withaws configure ssooraws login. If no profile is selected, the error suggests the default profile, because the SDK uses it with no flag.sso_account_idandsso_role_nameor fromrole_arn. It shows five profiles at most. If it does not show all of them, it namesaws configure list-profiles.ErrNoRegionuses the same format, and it tells the user that the region can come from the AWS profile.The help text for
aws-devops-agentnow gives the order of the profile and region sources.Example, from a computer with no default profile:
Additional context
The command is hidden, so users do not see these messages yet.
🤖 Generated with Claude Code
Note
Overview
Improves AWS credential and region failures for the hidden
aws-devops-agentcommands so users get actionable guidance instead of opaque SDK errors.NewClientsand errors: Missing or invalid profiles are handled explicitly (including SDK “profile does not exist”), and when there is no region but named profiles exist and nothing is selected, the CLI surfaces “no profile selected” before “no region”.ErrNoRegionnow lists fixes (--region,AWS_REGION, or region on the profile). Credential errors use a consistent “To fix this, … OR …” pattern (--profile,export AWS_PROFILE,aws configure sso/aws login). Profile lists are tabular (name, account, role from config), show up to 10 profiles, and when the default chain fails without an explicit profile, messages suggest picking another profile from the list.Docs: Command long help and
--regionflag text describe resolution order:--profile→AWS_PROFILE→ default, and--region→AWS_REGION→ profile.Tests are updated and expanded for the new message shapes and edge cases.
Reviewed by Cursor Bugbot for commit 2422030. Bugbot is set up for automated code reviews on this repo. Configure here.