forked from extern/ohmyzsh
feat(aws): add support for sso sessions login (#12090)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
This commit is contained in:
parent
94a0481f18
commit
3e92d251ba
@ -16,6 +16,7 @@ plugins=(... aws)
|
|||||||
It also sets `$AWS_EB_PROFILE` to `<profile>` for the Elastic Beanstalk CLI. It sets `$AWS_PROFILE_REGION` for display in `aws_prompt_info`.
|
It also sets `$AWS_EB_PROFILE` to `<profile>` for the Elastic Beanstalk CLI. It sets `$AWS_PROFILE_REGION` for display in `aws_prompt_info`.
|
||||||
Run `asp` without arguments to clear the profile.
|
Run `asp` without arguments to clear the profile.
|
||||||
* `asp [<profile>] login`: If AWS SSO has been configured in your aws profile, it will run the `aws sso login` command following profile selection.
|
* `asp [<profile>] login`: If AWS SSO has been configured in your aws profile, it will run the `aws sso login` command following profile selection.
|
||||||
|
* `asp [<profile>] login [<sso_session>]`: In addition to `asp [<profile>] login`, if SSO session has been configured in your aws profile, it will run the `aws sso login --sso-session <sso_session>` command following profile selection.
|
||||||
* `asp [<profile>] logout`: If AWS SSO has been configured in your aws profile, it will run the `aws sso logout` command following profile selection.
|
* `asp [<profile>] logout`: If AWS SSO has been configured in your aws profile, it will run the `aws sso logout` command following profile selection.
|
||||||
|
|
||||||
* `asr [<region>]`: sets `$AWS_REGION` and `$AWS_DEFAULT_REGION` (legacy) to `<region>`.
|
* `asr [<region>]`: sets `$AWS_REGION` and `$AWS_DEFAULT_REGION` (legacy) to `<region>`.
|
||||||
|
@ -29,7 +29,11 @@ function asp() {
|
|||||||
export AWS_PROFILE_REGION=$(aws configure get region)
|
export AWS_PROFILE_REGION=$(aws configure get region)
|
||||||
|
|
||||||
if [[ "$2" == "login" ]]; then
|
if [[ "$2" == "login" ]]; then
|
||||||
aws sso login
|
if [[ -n "$3" ]]; then
|
||||||
|
aws sso login --sso-session $3
|
||||||
|
else
|
||||||
|
aws sso login
|
||||||
|
fi
|
||||||
elif [[ "$2" == "logout" ]]; then
|
elif [[ "$2" == "logout" ]]; then
|
||||||
aws sso logout
|
aws sso logout
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user