mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-29 09:10:07 +00:00
fix(aws): allow for profile switch w/o MFA configured (#9924)
This commit is contained in:
parent
e4f6f1698d
commit
23f9348e2c
1 changed files with 35 additions and 35 deletions
|
@ -62,6 +62,7 @@ function acp() {
|
||||||
read -r sess_duration
|
read -r sess_duration
|
||||||
fi
|
fi
|
||||||
mfa_opt=(--serial-number "$mfa_serial" --token-code "$mfa_token" --duration-seconds "${sess_duration:-3600}")
|
mfa_opt=(--serial-number "$mfa_serial" --token-code "$mfa_token" --duration-seconds "${sess_duration:-3600}")
|
||||||
|
fi
|
||||||
|
|
||||||
# Now see whether we need to just MFA for the current role, or assume a different one
|
# Now see whether we need to just MFA for the current role, or assume a different one
|
||||||
local role_arn="$(aws configure get role_arn --profile $profile)"
|
local role_arn="$(aws configure get role_arn --profile $profile)"
|
||||||
|
@ -103,7 +104,6 @@ function acp() {
|
||||||
aws_secret_access_key="${credentials[2]}"
|
aws_secret_access_key="${credentials[2]}"
|
||||||
aws_session_token="${credentials[3]}"
|
aws_session_token="${credentials[3]}"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# Switch to AWS profile
|
# Switch to AWS profile
|
||||||
if [[ -n "${aws_access_key_id}" && -n "$aws_secret_access_key" ]]; then
|
if [[ -n "${aws_access_key_id}" && -n "$aws_secret_access_key" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue