Metadata-Version: 2.1
Name: aec-cli
Version: 2.12.1
Summary: AWS EC2 CLI
License: MIT License
        
        Copyright (c) 2019 SEEK
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of
        this software and associated documentation files (the "Software"), to deal in
        the Software without restriction, including without limitation the rights to
        use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
        the Software, and to permit persons to whom the Software is furnished to do so,
        subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
        FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
        COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
        IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
        CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Project-URL: homepage, https://github.com/seek-oss/aec
Keywords: AWS,EC2,command line,cli
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: boto3 (==1.28.1)
Requires-Dist: importlib-resources (==5.12.0)
Requires-Dist: pytoml (==0.1.21)
Requires-Dist: pytz (==2023.3)
Requires-Dist: requests (==2.31.0)
Requires-Dist: rich (==13.4.2)
Requires-Dist: typing-extensions (==4.7.1)
Provides-Extra: dev
Requires-Dist: black (~=23.1) ; extra == 'dev'
Requires-Dist: build (~=0.7) ; extra == 'dev'
Requires-Dist: boto3-stubs[compute-optimizer,ec2,s3,ssm] ; extra == 'dev'
Requires-Dist: cogapp (~=3.3) ; extra == 'dev'
Requires-Dist: dirty-equals (~=0.6) ; extra == 'dev'
Requires-Dist: moto[ec2] (~=4.1) ; extra == 'dev'
Requires-Dist: pre-commit (~=2.20) ; extra == 'dev'
Requires-Dist: pyfakefs (~=5.1) ; extra == 'dev'
Requires-Dist: pytest (~=7.4) ; extra == 'dev'
Requires-Dist: pytest-mock (~=3.11) ; extra == 'dev'
Requires-Dist: ruff (~=0.0.277) ; extra == 'dev'
Requires-Dist: twine (~=4.0) ; extra == 'dev'

# AWS EC2 CLI

[![Build](https://github.com/seek-oss/aec/actions/workflows/ci.yml/badge.svg)](https://github.com/seek-oss/aec/actions/workflows/ci.yml)
[![Release](https://github.com/seek-oss/aec/actions/workflows/release.yml/badge.svg)](https://github.com/seek-oss/aec/actions/workflows/release.yml)
[![PyPI version](https://badge.fury.io/py/aec-cli.svg)](https://pypi.org/project/aec-cli/)

_"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](src/aec/config-example/ec2.toml), which supports multiple profiles for different regions or AWS accounts.

For examples see:

- [EC2](docs/ec2.md) - 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](docs/ami.md) - describe, delete and share images
- [Compute Optimizer](docs/compute-optimizer.md) - show over-provisioned instances
- [SSM](docs/ssm.md) - run commands on instances, and [ssm patch management](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-patch.html)

## 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](https://github.com/pipxproject/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](src/aec/config-example/) 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
```

## Similar projects

[wallix/awless](https://github.com/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](https://github.com/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.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) to get started and develop in this repo.
