mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2025-12-09 17:00:44 +01:00
feat(aws): accept aws mfa tokencode on acp cli call (#10130)
Co-authored-by: Mike Mattice <mmattice@reliant.io>
This commit is contained in:
@@ -45,6 +45,7 @@ function acp() {
|
||||
fi
|
||||
|
||||
local profile="$1"
|
||||
local mfa_token="$2"
|
||||
|
||||
# Get fallback credentials for if the aws command fails or no command is run
|
||||
local aws_access_key_id="$(aws configure get aws_access_key_id --profile $profile)"
|
||||
@@ -58,9 +59,10 @@ function acp() {
|
||||
|
||||
if [[ -n "$mfa_serial" ]]; then
|
||||
local -a mfa_opt
|
||||
local mfa_token
|
||||
echo -n "Please enter your MFA token for $mfa_serial: "
|
||||
read -r mfa_token
|
||||
if [[ -z "$mfa_token" ]]; then
|
||||
echo -n "Please enter your MFA token for $mfa_serial: "
|
||||
read -r mfa_token
|
||||
fi
|
||||
if [[ -z "$sess_duration" ]]; then
|
||||
echo -n "Please enter the session duration in seconds (900-43200; default: 3600, which is the default maximum for a role): "
|
||||
read -r sess_duration
|
||||
|
||||
Reference in New Issue
Block a user