Changes to aswprofile, for region

This commit is contained in:
Andrea Mistrali 2021-11-02 10:21:06 +01:00
parent 48634fc7a8
commit 8b02f06f98
No known key found for this signature in database
GPG Key ID: 6FB0A77F6D5DA9B2
2 changed files with 3 additions and 2 deletions

View File

@ -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

Binary file not shown.