diff --git a/zsh.d/zshfunctions/awsprofile b/zsh.d/zshfunctions/awsprofile index a486f3c..0e8cd2d 100644 --- a/zsh.d/zshfunctions/awsprofile +++ b/zsh.d/zshfunctions/awsprofile @@ -14,7 +14,8 @@ if [ $profile ]; then # We got a profile pattern, look for a match echo "Activating profile $match" export AWS_DEFAULT_PROFILE=$match export AWS_PROFILE=$match - export AWS_EB_PROFILE=$match + export AWS_DEFAULT_REGION=$(grep -A1 $match ~/.aws/config|grep region|cut -d" " -f3) + export AWS_REGION=${AWS_DEFAULT_REGION} return else echo "No match for $profile" @@ -22,7 +23,7 @@ if [ $profile ]; then # We got a profile pattern, look for a match fi elif [ $AWS_PROFILE ]; then # no profile passed, clean up current one, logout - unset AWS_DEFAULT_PROFILE AWS_PROFILE AWS_EB_PROFILE + unset AWS_DEFAULT_PROFILE AWS_PROFILE AWS_DEFAULT_REGION AWS_REGION echo profile cleared. return fi diff --git a/zsh.d/zshfunctions/awsprofile.zwc b/zsh.d/zshfunctions/awsprofile.zwc index 37569e9..952cb56 100644 Binary files a/zsh.d/zshfunctions/awsprofile.zwc and b/zsh.d/zshfunctions/awsprofile.zwc differ