7

I installed EB CLI following these instructions.

To use it, I configured AWS CLI for SSO following these instructions.

This creates a config file in ~/.aws/config with these contents:

[profile <profile_name>]
sso_session = <session_name>
sso_account_id = <account_no>
sso_role_name = <role_name>
region = <region>
output = json
[sso-session <session_name>]
sso_start_url = <start_url>
sso_region = <region>
sso_registration_scopes = <scopes>

All the values seem to be correct.

Once configured, I can login using SSO using:

aws sso login --profile <profile_name>

This redirects me to the SSO <start_url> and I get the confirmation for login:

Successfully logged into Start URL: <start_url>

EB CLI is supposed to be able to login using the authentication methods set with AWS CLI. I am trying to do so with:

eb init --profile <profile_name>

However, after selecting the region, I get this error:

ERROR: InvalidConfigError - The profile "<profile_name>" is configured to use SSO but is missing required configuration: sso_start_url, sso_region

I am not sure what I am missing as the ~/.aws/config file seems to be properly set with the sso_start_url and sso_region I specified in the AWS CLI configuration.

Is there any other intermediate step to get EB CLI working with SSO?

buzoherbert
  • 1,537
  • 1
  • 12
  • 34
  • 1
    I copied the sso related lines into the profile section of the config file: `sso_start_url = sso_region = ` But now I am getting this error: `2022-12-25 14:01:03,948 (ERROR) ebcli.lib.aws : Botocore Error ERROR: SSOTokenLoadError - Error loading SSO Token: The SSO access token has either expired or is otherwise invalid.` – buzoherbert Dec 25 '22 at 06:04

1 Answers1

2

I had a similar problem, but with boto3, not EB. Same error message though, in my Python script when I created a client. I realised that in the virtual environment, I hadn't updated boto3 in two years. When I updated it, it worked. Try updating your EB CLI or boto3 if you have that.

pashri
  • 81
  • 4