AWS Command Aliases

Create a minimal alias file:

> mkdir -p ~/.aws/cli
> echo '[toplevel]' > ~/.aws/cli/alias
> cat ~/.aws/cli/alias
[toplevel]

Add an “internal command alias“ to the alias file:

[toplevel]identity = sts get-caller-identity
> aws sts get-caller-identity

Add a “shell command alias” to the alias file:

[toplevel]account = ! cat ~/.aws/credentials | grep '^\(account\|assumed\)_' | cut -d ' ' -f3 | tr '\n' ' ' | awk '{ printf "Account: %s (%s) Role: %s", $1, $2, $3 }'

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Wil (₩) Moore III

Wil (₩) Moore III

Technical Writer, Software Engineer Specializing in NodeJS, TypeScript, React & React Native, SQL, DevOps, AWS, Azure, & ElasticSearch. Author of selectn.js.