When SSO is Expired
Great! you have now configured AWS SSO with the AWS CLI, allowing you to run AWS CLI commands to interact with various AWS services.
For example, you can run commands like
aws s3 ls --profile awslaunchgoat-prod
This command will list all S3 buckets associated with the awslaunchgoat-prod profile.
Right now, it will probably list nothing because we haven't created any buckets yet.
However, after 1 hour and if you try above command again, you will see something like this.
⚠️ AWS SSO tokens are cached and will expire after a set period (we set it as 1 hour). When the token expires, you'll need to re-authenticate by running a command with your profile, and the AWS CLI will prompt you to re-authenticate.
If you need to re-authenticate, you can run
- aws sso login --profile [your profile name]
i.e. aws sso login --profile awslaunchgoat-prod
Then it will open a browser and prompt you to authenticate again.