A collection of plugins that extend the amazon command line utility.
The provided plugin gives some colorized output listing the current month's CVEs for Amazon Linux 2.
❯ aws cve
Publishing this month's CVE's for Amazon Linux 2 ...
07-17-2023 | ALAS-2023-2152 (medium): squashfs-tools
07-17-2023 | ALAS-2023-2151 (medium): python-pip
07-17-2023 | ALAS-2023-2150 (medium): python-rsa
07-17-2023 | ALAS-2023-2149 (important): ipa
...
Although it's not very well documented, it's possible to write plugins for the aws cli. This issue provides some details, and this repo led me to having a working plugin.
For most common operations using the aws cli, using an alias is a simpler way to add functionality to the aws cli.
In other more complex scenarios, where low-level access to the client is required, or where some 3rd party is being integrated with, a plugin makes more sense.
- First, plugins must be importable:
import aws_cli_plugins # needs to work ...
- the plugin also needs a method called
awscli_initialize
which will inject the new commands you're adding into the command table. - your command (and subcommands) must inherit from the aws cli's BasicCommand
- your commands need to implement the
_run_main
method ofBasicCommand
take a look at s3 for a good reference on making subcommands and interacting with the boto session.