This repository is a consolidated collection of AWS cli aliases from several locations on the internet.
An alias - is a shortcut (for the lack better term) that you can use to speed up your day to day work with the AWS CLI.
The command is built into the aws cli - you can have a look here to see how this implemented.
Essentially - you create an alias
file in .aws/cli/alias
and you populate the file with the shortcuts you would like. Support for aliases was added in this PR - and if you would like to see exactly what is supported - please go through the PR.
Based on the information from the PR the alias
file is an INI
file, and you define the aliases and their values in the file.
- The
~/.aws/cli/alias
file only has support for the[toplevel]
section. Any other sections, will be ignored. - Aliases defined under the
[toplevel]
section will only be applied at the service command level. - Aliases can defined using multiple lines for readability.
You can find more information on the following blog post.
The file has been divided into sections based on the types of commands that are involved with the aliases.
- general commands
- IAM
- EC2
- CloudWatch
- ECR
Let's have a look at a simple alias
file example. First you put in a [toplevel]
declaration at the top of the file, and your alias below that.
[toplevel]
whoami = sts get-caller-identity
and when you run aws whoami
it will replace the command the value sts get-caller-identity
Your alias can also contain a function - which is essentially a wrapper for a shell command and looks like this.
!f() {
<_Enter some shell command here_>
}; f
- https://github.com/awslabs/awscli-aliases/blob/master/alias (1, 2, 3, 8, 9, 9, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28)
- https://github.com/3-shake/awscli-aliases/blob/master/alias (29)
- https://github.com/dedelala/awscli-aliases/blob/lambda-last-log/alias (52)
- https://github.com/faizanbashir/awscli-aliases/blob/master/alias (30)
- https://github.com/Voronenko/dotfiles/blob/b120063fd8531c3b054cf5dda2fdec6bd222bf74/aws/alias (53)
- https://github.com/LanikSJ/awscli-aliases/blob/master/alias (34, 35)
- https://github.com/jameszh/awscli-aliases/blob/master/alias (31, 32)
- https://github.com/limed/awscli-aliases/blob/add-list-all-regions/alias (33)
- https://github.com/mbainter/awscli-aliases/blob/personal_aliases/alias (10, 11, 12)
- https://github.com/otanner/awscli-aliases/blob/master/alias (13, 14, 36, 37, 38, 39, 40, 41)
- https://github.com/pwmcintyre/awscli-aliases/blob/master/alias (15)
- https://gist.github.com/jamesls/3623e9589db175509ec2c61536b6c6b9 (4, 5, 6)
- https://github.com/skatsuta/awscli-aliases/blob/master/alias (7)
- https://github.com/tchia04/awscli-aliases/blob/master/alias (42, 43, 44, 45, 46, 47, 48, 49)
- https://github.com/tchia04/awscli-aliases/blob/instance_id_and_dns_conversion/alias (50, 51)