Awless - a powerful alternative CLI utility for working with AWS services

All users of Amazon cloud services have long known about their native console tool for working with them - aws-cli. But it turned out that not everyone has enough of it: for this reason, WALLIX released an alternative and more functional solution called awless .
The awless source code is written in Go (uses the AWS Go SDK) and published on GitHub under a free license (Apache License 2.0). The current version of awless is 0.1.0. Supported operating systems are GNU / Linux, Mac OS X and Windows. What does this utility allow?
Opportunities
Awless supports the following AWS services / features:
- EC2;
- IAM
- S3;
- RDS
- Auto Scaling
- SNS
- SQS;
- Route53;
- CloudWatch
- CloudFormation
- Lambda
One of the main features of the utility is output in different formats : both in human-readable (tables compatible with Markdown markup) and in machine ones (CSV, TSV, JSON), which will ensure the convenience of working with data in scripts using awless. If you interact with the tool manually, another nice option is auto - completion of commands (Bash and Zsh shells are supported - how to activate, see the output
awless completion). Another interesting awless feature is the command template engine , which allows you to create entire sets of operations performed in AWS (and launched by a single-line command). An example is the already built-in awless template for creating a new EC2 instance:
$ awless create instance subnet=subnet-356d517f image=ami-70edb016 type=t2.microA feature of such a command is the transfer of parameters in the form of a key-value, which are used to perform additional operations (in this case, the subnet and the AMI image to run in a new instance).
Among other awless features:
- filtering resource lists by their properties and tags;
- the ability to use arbitrary aliases for resource names;
- AWS userdata support for provisioning (execution of arbitrary remote or local scripts) on newly created instances;
- logging of performed operations (
awless log); - cancellation of resources created using templates (
awless revertwith the operation identifier from the log); - Simple SSH access to instances (
awless ssh); - viewing resource data offline (requires a preliminary launch
awless syncfor local data storage).
Installation
Installing awless comes down to the command:
$ curl https://raw.githubusercontent.com/wallix/awless/master/getawless.sh | bash... or (if Go is installed):
$ go get -u github.com/wallix/awlessIn addition, ready-made archives with awless for different platforms are available for download on the release page .
Awless examples
The developers have prepared a cool video demonstrating the work with the utility. However ... it uses the animated PNG format - APNG, so for viewing in Chrome you will need the latest version 59 or a special addition , and since watching it again in Firefox led to inadequate memory consumption, I’ll leave this video as a link instead of embedding it in a post.
Examples of specific operations (taken from the documentation and built-in help):
- List of instances sorted by their working time:
$ awless list instances --sort uptime - User output by user name or ID:
$ awless show jsmith - Creating an instance and provision into it from Gist:
$ awless create instance name=my_machine image=ami-3f1bd150 keypair={keypair.name} \
subnet={main.subnet} securitygroup={securitygroup} \
userdata=https://gist.github.com/simcap/360dffae4c6d76ab0e89621dd824a244 - User policy definition:
$ awless attach policy user=jsmith arn=arn:aws:iam::aws:policy/AmazonEC2FullAccess - Uploading a local file to S3:
$ awless create s3object bucket=my-existing-bucket file=./todolist.txt - Creating an instance and logging in to it via SSH (by local key):
$ awless run repo:instance_ssh
Please specify (Ctrl+C to quit):
instance.name ? my-new-instance-name
instance.subnet ? @my-existing-subnet
instance.vpc ? @my-existing-vpc
keypair.name ? my-new-keyname
$ awless ssh my-new-instance-name
Conclusion
The number of awless stars on GitHub is approaching 3 thousand, and this is a clear indicator that such a tool was expected. The project has a wiki in which you can get more information on its installation and use. In addition, all teams have a fairly detailed built-in help - a flag
-h(for example, awless create instance -h).PS
Read also in our blog: