mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-10-14 14:39:08 +00:00
[aws] Add function to activate and switch profiles taken from aws credentials file
This commit is contained in:
@@ -127,3 +127,12 @@ function aws_cf {
|
||||
function ssh_aws_any {
|
||||
aws_ssm_session_any $1 ssh
|
||||
}
|
||||
|
||||
function aws_switch_profile {
|
||||
echo "Activating profile $1..."
|
||||
export AWS_PROFILE=$1
|
||||
|
||||
if [[ -f ~/.aws/credentials ]]; then #&& (( ! ${+AWS_DEFAULT_REGION} ))
|
||||
export AWS_DEFAULT_REGION=$(aws configure get region)
|
||||
fi
|
||||
}
|
||||
|
Reference in New Issue
Block a user