Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AWS SSO] SSO credentials expired, but error message saids unable to resolve AWS account #20896

Closed
TiansuYu opened this issue Jun 28, 2022 · 5 comments
Labels
@aws-cdk/aws-sso Related to the @aws-cdk/aws-sso package effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@TiansuYu
Copy link

Describe the bug

When trying to deploy stacks through cdk deploy, if your local aws sso crendentials has expired, cdk CLI will prompt the following message:

Unable to resolve AWS account to use. It must be either configured when you define your CDK Stack, or through the environment

which leads users to debug their CLI configurations (either through cdk ... --profile xxx or set env var such as AWS_PROFILE and CDK_DEFAULT_PROFILE.) But the real issue I had was that my AWS SSO session has expired, I just need to do aws sso login again.

I think this error message is misleading in this situation and needs to be improved.

Expected Behavior

When your AWS SSO session has expired, cdk CLI should prompt you with error message such as The SSO session associated with profile $<some-profile> has expired or is otherwise invalid. To refresh this SSO session run aws sso login with the corresponding profile.

Current Behavior

CDK CLI cannot tell the difference between an expired AWS SSO credential and your AWS profile is unset with regard to CDK.

Reproduction Steps

Point CDK CLI to an expired AWS SSO profile, and have a local dummy stack definition. Then run cdk deploy.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.28.1 (build d035432)

Framework Version

No response

Node.js Version

18.2.0

OS

MacOS 12.4

Language

Typescript

Language Version

No response

Other information

No response

@TiansuYu TiansuYu added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 28, 2022
@github-actions github-actions bot added the @aws-cdk/aws-sso Related to the @aws-cdk/aws-sso package label Jun 28, 2022
@peterwoodworth peterwoodworth added feature-request A feature should be added or improved. p2 effort/medium Medium work item – several days of effort and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 1, 2022
@peterwoodworth
Copy link
Contributor

Thanks for submitting this, we accept contributions! Check out our contributing guide if you're interested - there's a low chance the team will be able to address this soon but we'd be happy to review a PR 🙂

@TiansuYu
Copy link
Author

TiansuYu commented Jul 4, 2022

I am not a typescript expert but will take a look and see what I can do about it.

@Naumel Naumel removed their assignment Jun 28, 2023
@TheRealAmazonKendra TheRealAmazonKendra self-assigned this Oct 10, 2024
@TheRealAmazonKendra
Copy link
Contributor

We will improve this error message as a part of #31702

@TheRealAmazonKendra
Copy link
Contributor

From the testing I've done, this error message is now clear when these credentials have expired.

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-sso Related to the @aws-cdk/aws-sso package effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

5 participants