Skip to content

doodaz/aws-alias

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

AWS CLI alias

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

Simple alias

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

Functions and commands

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

Sources

About

Aliases for AWS CLI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published