Skip to main content

AWS EC2 CLI

Project description

AWS EC2 CLI

Build PyPI version

"Instead of using the console, use the cli!".

Command-line tools for managing pet EC2 instances by name.

Defaults only need to be supplied once via a config file, which supports multiple profiles for different regions or AWS accounts.

For examples see:

  • EC2 - manipulate EC2 instances by name, and launch them with tags and EBS volumes of any size, as per the settings in the configuration file (subnet, security group etc).
  • AMI - describe, delete and share images
  • Compute Optimizer - show over-provisioned instances
  • SSM - run commands on instances, and ssm patch management

Prerequisites

  • python 3.7+
    • Ubuntu 20.04: sudo apt install python3 python3-pip python3-dev python3-venv
  • automake:
    • Ubuntu: sudo apt install automake
    • macOS: brew install automake

Install

Run the following to install the latest master version using pip:

pip install aec-cli

If you have previously installed aec, run the following to upgrade to the latest version:

pip install --upgrade aec-cli

NB: Consider using pipx to install aec-cli into its own isolated virtualenv.

Configure

Before you can use aec, you will need to create the config files in ~/.aec/. The config files contain settings for your AWS account including VPC details and additional tagging requirements.

To get started, run aec configure example to install the example config files and then update them as needed.

Handy aliases

For even faster access to aec subcommands, you may like to add the following aliases to your .bashrc:

alias ec2='COLUMNS=$COLUMNS aec ec2'
alias ami='COLUMNS=$COLUMNS aec ami'
alias ssm='COLUMNS=$COLUMNS aec ssm'

COLUMNS=$COLUMNS will ensure output is formatted to the width of your terminal when piped.

FAQ

How do I use aec with other AWS profiles?

To use aec with the named profile 'production':

export AWS_DEFAULT_PROFILE=production
aec ec2 describe

Development

Pre-reqs:

  • make
  • node (required for pyright)

To get started run make install. This will:

  • install git hooks for formatting & linting on git push
  • create the virtualenv
  • install this package in editable mode

Then run make to see the options for running checks, tests etc.

Similar projects

wallix/awless is written in Go, and is an excellent substitute for awscli with support for many AWS services. It has human friendly commands for use on the command line or in templates. Unlike aec its ec2 create instance command doesn't allow you to specify the EBS volume size, or add tags.

achiku/jungle is written in Python, and incorporates a smaller subset of ec2 commands and doesn't launch new instances. It does however have an ec2 ssh command. It also supports other AWS services like ELB, EMR, RDS.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aec-cli-2.4.0.tar.gz (38.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aec_cli-2.4.0-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

Details for the file aec-cli-2.4.0.tar.gz.

File metadata

  • Download URL: aec-cli-2.4.0.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for aec-cli-2.4.0.tar.gz
Algorithm Hash digest
SHA256 478af06071c7faa42fbf88c58354dd046d808a4f0bd7feb5ce2fbdc0594b848d
MD5 e6cb981886f56aa7cd9ad79cc7da641a
BLAKE2b-256 75db6662beaa062eac705e18bed1c846911a7cfda9893136138ff8422f12636c

See more details on using hashes here.

File details

Details for the file aec_cli-2.4.0-py3-none-any.whl.

File metadata

  • Download URL: aec_cli-2.4.0-py3-none-any.whl
  • Upload date:
  • Size: 49.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for aec_cli-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 275020c10e405be69018091b095d9bf92b5bd8721f692be579dddfdcd0d73b84
MD5 bbe8d75637bbeb28a2a7dabbf9dd7e23
BLAKE2b-256 0e55511035e8f232b1e6b86d492e85757de9e9a86c30e0bcb9ad3a7f65c3899e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page