未验证 提交 23f9348e 编写于 作者: S Sergei Shvetsov 提交者: GitHub

fix(aws): allow for profile switch w/o MFA configured (#9924)

上级 e4f6f169
......@@ -62,6 +62,7 @@ function acp() {
read -r sess_duration
fi
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
local role_arn="$(aws configure get role_arn --profile $profile)"
......@@ -103,7 +104,6 @@ function acp() {
aws_secret_access_key="${credentials[2]}"
aws_session_token="${credentials[3]}"
fi
fi
# Switch to AWS profile
if [[ -n "${aws_access_key_id}" && -n "$aws_secret_access_key" ]]; then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册