Repository for AWS CLI aliases.
This repository contains a set of aliases for the AWS CLI. The aliases are defined in the alias file and can be used to simplify the usage of the AWS CLI.
The aliases are defined in the following format:
alias <alias-name>='<command>'For example:
alias whoami='aws sts get-caller-identity'The above alias can be used to get the account ID, user ID, and ARN of the IAM user whose credentials are being used to run the command.
$ aws whoamiThe above command is equivalent to running:
$ aws sts get-caller-identityFor more information, see the following documentation: AWS CLI Alias Usage
Make sure that you are using version 1.11.24 or higher of the AWS CLI.
You can determine the version by running:
$ aws --versionYou can download the latest version of the AWS CLI from the following link: https://aws.amazon.com/cli/.
The tostring alias requires to have the jp command installed.
For installing the command line interface for JMESPath i.e. jp, see: https://github.com/jmespath/jp.
$ brew install jp$ sudo apt-get install jpThe tostring-with-jq alias requires to have the jq command installed.
For installing the command-line JSON processor i.e. jq, see: https://jqlang.github.io/jq/download/.
$ brew install jq$ sudo apt-get install jqTo start using aliases available in this repository, run the following commands:
$ git clone
$ mkdir -p ~/.aws/cli
$ cp awscli-aliases/alias ~/.aws/cli/aliasTo test that the aliases now work, run the following alias:
aws whoamiThis should display the same response as the aws sts get-caller-identity command:
{
  "Account": "012345678901",
  "UserId": "AIUAINBADX2VEG2TC6HD6",
  "Arn": "arn:aws:iam::012345678901:user/myuser"
}Contributions are welcome! For more information, see the CONTRIBUTING file.