Software Engineering :: Cloud :: AWS :: CLI :: Command :: Alias
⪼ Made with 💜 by Polyglot.
Similar to git aliases
mkdir -p ~/.aws/cli && echo '[toplevel]' > ~/.aws/cli/alias
[toplevel]
fed = ! cat ~/.aws/credentials | grep '^\(account\|assumed\)_' | cut -d ' ' -f3 | tr '\n' ' ' | awk '{ printf "Account: %s (%s) Role: %s", $1, $2, $3 }'
account = fed
identity = sts get-caller-identity
NOTE: The above alias file defines an identity command, as well as a fed command and an account command that is itself an alias to another alias fed.
> aws account
Account: 755203376857 (AWS_MQ@teamaol.com) Role: sso/fed.admin.user