mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-14 09:50:08 +00:00
feat(aws): Adds the login option for AWS SSO (#9921)
This commit is contained in:
parent
58478d0888
commit
bf303965e6
2 changed files with 5 additions and 0 deletions
|
@ -14,6 +14,7 @@ plugins=(... aws)
|
||||||
* `asp [<profile>]`: sets `$AWS_PROFILE` and `$AWS_DEFAULT_PROFILE` (legacy) to `<profile>`.
|
* `asp [<profile>]`: sets `$AWS_PROFILE` and `$AWS_DEFAULT_PROFILE` (legacy) to `<profile>`.
|
||||||
It also sets `$AWS_EB_PROFILE` to `<profile>` for the Elastic Beanstalk CLI.
|
It also sets `$AWS_EB_PROFILE` to `<profile>` for the Elastic Beanstalk CLI.
|
||||||
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.
|
||||||
|
|
||||||
* `acp [<profile>]`: in addition to `asp` functionality, it actually changes the profile by
|
* `acp [<profile>]`: in addition to `asp` functionality, it actually changes the profile by
|
||||||
assuming the role specified in the `<profile>` configuration. It supports MFA and sets
|
assuming the role specified in the `<profile>` configuration. It supports MFA and sets
|
||||||
|
|
|
@ -21,6 +21,10 @@ function asp() {
|
||||||
export AWS_DEFAULT_PROFILE=$1
|
export AWS_DEFAULT_PROFILE=$1
|
||||||
export AWS_PROFILE=$1
|
export AWS_PROFILE=$1
|
||||||
export AWS_EB_PROFILE=$1
|
export AWS_EB_PROFILE=$1
|
||||||
|
|
||||||
|
if [[ "$2" == "login" ]]; then
|
||||||
|
aws sso login
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# AWS profile switch
|
# AWS profile switch
|
||||||
|
|
Loading…
Reference in a new issue