mirror of
https://github.com/nikdoof/dotfiles.git
synced 2025-12-13 01:32:30 +00:00
[shell-common] Add profile display name to awslogin/logout command
This commit is contained in:
@@ -98,13 +98,28 @@ function awslogin() {
|
||||
return 2
|
||||
fi
|
||||
echo "AWS login successful. Credentials exported."
|
||||
export AWS_PROFILE_ACTIVE="$profile"
|
||||
if [[ -n "$profile" ]]; then
|
||||
export AWS_PROFILE_DISPLAY="[aws: $profile]"
|
||||
else
|
||||
export AWS_PROFILE_DISPLAY=""
|
||||
fi
|
||||
}
|
||||
|
||||
function awslogout() {
|
||||
unset AWS_PROFILE_ACTIVE
|
||||
unset AWS_ACCESS_KEY_ID
|
||||
unset AWS_SECRET_ACCESS_KEY
|
||||
unset AWS_SESSION_TOKEN
|
||||
export AWS_PROFILE_DISPLAY=""
|
||||
echo "AWS profile and credentials cleared."
|
||||
}
|
||||
|
||||
# easy access to SSH
|
||||
function awsssh() {
|
||||
local profile=""
|
||||
local region=""
|
||||
local username="ec2-user"
|
||||
local username="ansible"
|
||||
local search=""
|
||||
|
||||
# Parse arguments
|
||||
|
||||
Reference in New Issue
Block a user