
All users of Amazon cloud services have long known about the native console tool for working with them - aws-cli. But it turned out that not everybody is enough of it: for this reason, WALLIX has 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 awless version is 0.1.0. GNU / Linux, Mac OS X, and Windows operating systems are supported. 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 to different formats : both in human-readable (tables compatible with Markdown markup) and machine (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
command autocompletion (Bash and Zsh shells are supported — how to activate, see the
awless completion
output).
Another awless interesting feature is
a template engine for commands that allows you to create entire sets of operations performed in AWS (and run with a single-line command). An example would be an already built-in awless template for creating a new EC2 instance:
$ awless create instance subnet=subnet-356d517f image=ami-70edb016 type=t2.micro
The peculiarity of this 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 features awless:
- filtering resource lists by their properties and tags;
- the possibility of using arbitrary aliases for resource names;
- AWS userdata support for provisioning (execution of arbitrary remote or local scripts) on new instances created;
- logging operations performed (
awless log
); - cancellation of resources created using templates (
awless revert
with an operation identifier from the log); - simple SSH access to instances (
awless ssh
); - viewing resource data offline (requires
awless sync
pre-launch for local data storage).
Installation
Installing awless boils down to running the command:
$ curl https://raw.githubusercontent.com/wallix/awless/master/getawless.sh | bash
... or (if there is an installed Go):
$ go get -u github.com/wallix/awless
In addition, ready-made archives with awless for different platforms are available for download on
the release page .
Awless usage 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 regular viewing it in Firefox led to inadequate memory consumption, I will leave this video a
link instead of embedding it in a post.
Examples of specific operations (taken from the
documentation and online help):
- The list of copies sorted by their work time:
$ awless list instances --sort uptime
- User output by user name or ID:
$ awless show jsmith
- Creating an instance and provisioning to 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
- Defining user policy:
$ awless attach policy user=jsmith arn=arn:aws:iam::aws:policy/AmazonEC2FullAccess
- Download local file to S3:
$ awless create s3object bucket=my-existing-bucket file=./todolist.txt
- Creating an instance and logging into 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 close to 3 thousand, and this is a clear indicator that we have been waiting for such a tool. The project has a
wiki in which you can get more information on its installation and use. In addition, all commands have sufficiently detailed built-in help - the
-h
flag (for example,
awless create instance -h
).
PS
Read also in our blog: