AWS CLI aliases

AWS CLI commands can be quite verbose, but happily there's a feature that isn't described in the main docs which allows you to create custom commands. To set it up do the following:

$ mkdir -p ~/.aws/cli
$ touch ~/.aws/cli/alias



whoami = sts get-caller-identity

profiles = 
  !f() {
    cat ~/.aws/credentials \
    | awk '/\[.*\]/' \
    | tr -d '\[\]' \
    | sort
  }; f

Now you can create shorter aliases for more common or complicated commands and save yourself a bunch of time.

There are more examples in the awslabs repo.