Skip to content

feat: offer to run aws sso login when SSO credentials expire - #905

Closed
cchu-ld wants to merge 1 commit into
cchu/aws-devops-2-regionsfrom
cchu/aws-devops-3-sso-login
Closed

cchu-ld wants to merge 1 commit into
cchu/aws-devops-2-regionsfrom
cchu/aws-devops-3-sso-login

Conversation

@cchu-ld

@cchu-ld cchu-ld commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

This PR is part 3 of a stack of 7 PRs for ldcli aws-devops-agent. It goes on PR 2 of the stack. Review and merge the PRs in order.

  1. feat: ask which existing agent space to connect LaunchDarkly to #903 Agent space choice
  2. feat: add AWS regions, send the API version, and shorten credential errors #904 Regions, API version, credential error
  3. feat: offer to run aws sso login when SSO credentials expire #905 aws sso login offer (this PR)
  4. feat: show names and states in the plaintext status output #906 Readable status output
  5. feat: show the setup plan and ask before setup changes AWS #907 Setup plan and confirmation
  6. feat: run the setup plan that setup showed #908 Run the shown plan
  7. feat: choose the setup steps by who made the agent space #909 Ownership rule and existing spaces

Describe the solution you've provided

  • If the SSO session of a profile expired, setup and status ask to run aws sso login --profile <name>. If you answer yes, the command runs it and builds the AWS clients again. They ask only in a terminal.
  • Without --profile or AWS_PROFILE, the AWS SDK uses the default profile, so the offer uses it too.
  • The credential error gives the aws sso login advice only to SSO profiles. Other profiles get the SDK cause, but not the cause from the EC2 metadata service. That cause only says that no other source had credentials.

Describe alternatives you've considered

None.

Additional context

Testing: go test ./... and golangci-lint pass on this branch.

🤖 Generated with Claude Code

If credential lookup fails for a profile with SSO configuration, setup
and status ask to run aws sso login --profile <name>. If you answer
yes, the command runs it and builds the AWS clients again. Without
--profile or AWS_PROFILE, the SDK uses the default profile, so the
offer uses it too.

The credential error gives the aws sso login advice only to SSO
profiles. Other profiles get the SDK cause, but not the cause from the
EC2 metadata service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cchu-ld
cchu-ld force-pushed the cchu/aws-devops-3-sso-login branch from b962f21 to b850bae Compare October 20, 2026 16:55
@cchu-ld cchu-ld closed this Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant