Могу ли я получить учетные данные для учетной записи aws, используя sso в командной строке без браузера - PullRequest
0 голосов
/ 26 марта 2020

В настоящее время я использую awscli версии 2 для получения временных учетных данных в командной строке. Кажется, это требует участия браузера. Это не будет работать везде, как, например, на сервере. Я хотел бы иметь возможность получить временные учетные данные в командной строке для моей учетной записи пользователя, используя AWS SSO. Это возможно. Судя по тому, что я могу узнать из документации SDK здесь и утилиты awscli версии 2, кажется, что нет способа сделать это.

Тип предоставления OAuth2 с кодом устройства " Явно предназначен для аутентификации без браузера, как упомянуто здесь Но SDK AWS SSO, похоже, не в состоянии это поддержать.

Буду признателен за любые идеи / мысли / помощь по этому вопросу.

Спасибо, Vi sh

1 Ответ

0 голосов
/ 26 марта 2020

Источник: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html

To manually add AWS SSO support to a named profile, you must add the following keys and values to the profile definition in the file ~/.aws/config (Linux or macOS) or %USERPROFILE%/.aws/config (Windows).

sso_start_url
The URL that points to the organization's AWS SSO user portal.

sso_start_url = https://my-sso-portal.awsapps.com/start
sso_region
The AWS Region that contains the AWS SSO portal host. This is separate from, and can be a different region than the default CLI region parameter.

sso_region = us_west-2
sso_account_id
The AWS account ID that contains the IAM role that you want to use with this profile.

sso_account_id = 123456789011
sso_role_name
The name of the IAM role that defines the user's permissions when using this profile.

sso_role_name = ReadAccess
The presence of these keys identify this profile as one that uses AWS SSO to authenticate the user.

You can also include any other keys and values that are valid in the .aws/config file, such as region, output, or s3. However, you can't include any credential related values, such as role_arn or aws_secret_access_key. If you do, the AWS CLI produces an error.

   So a typical AWS SSO profile in .aws/config might look similar to the following example.

[profile my-dev-profile]
sso_start_url = https://my-sso-portal.awsapps.com/start
sso_region = us-east-1
sso_account_id = 123456789011
sso_role_name = readOnly
region = us-west-2
output = json```
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...