Metadata-Version: 2.1
Name: ecs_connect_cli
Version: 1.11.0
Summary: AWS ECS Cli tool for connecting to ecs container and update secret manager
Home-page: https://github.com/fegmorte/aws-ecs-exec-command-cli
License: MIT
Author: Frederic Egmorte
Author-email: frederic.egmorte@gmail.com
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: boto3 (>=1.26.13,<2.0.0)
Requires-Dist: deepdiff (>=6.7.1,<7.0.0)
Requires-Dist: echoprompt (>=0.2.0,<0.3.0)
Requires-Dist: pytest (>=6.2.4,<7.0.0)
Requires-Dist: typer[all] (>=0.9.0,<0.10.0)
Project-URL: Repository, https://github.com/fegmorte/aws-ecs-exec-command-cli
Description-Content-Type: text/markdown

# aws-ecs-exec-command-cli

AWS ECS Exec command cli tool is aimed to :

- connect to your container instance running under ECS Fargate.
- tail the log from cloudwatch logs (if you configure a logconfiguration in your task definition)
- update secret value into secret manager

&nbsp;

The `aws ecs execute-command` command is quite complicated to remember and the tool give you the ability to parse and retrieve:

- your clusters
- your services
- your tasks
- your container

To let you choose which one you want to connect into.

**Enhancements** 
You can now connect to ECS and tail your logs from an EC2 instance or AWS CloudShell without the need of aws cli and aws credentials file.

At start, you are asked what kind of credentials you want to use and which default region.

You can now also update your secret directly from the command line.

```bash
❯ python -m ecs_connect_cli update-secret your-secret-name
```

&nbsp;

## Installation

**Requirements**


- Install awscli via [https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html] (not necessary if you are connected to an EC2 instance)

- Install ssm  tools via [https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html]


&nbsp;

You should install the requirements via the pip install below.

&nbsp;

Create a virtualenv with python >= 3.9

&nbsp;

```bash
source .venv_3.11.0/bin/activate
pip install ecs-connect-cli
```

&nbsp;

if it is the first time you connect to aws-cli, you have to get credentials key from your aws administrator.

&nbsp;

## Usage

```bash
❯ python -m ecs_connect_cli --help


Welcome in AWS ECS Exec command Cli !

                                                                                                                                                                                       
 Usage: ecs_connect [OPTIONS] COMMAND [ARGS]...                                                                                                                                        
                                                                                                                                                                                       
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --version             -v        Show the application's version and exit.                                                                   │
│ --install-completion            Install completion for the current shell.                                                                  │
│ --show-completion               Show completion for the current shell, to copy it or customize the installation.                           │
│ --help                          Show this message and exit.                                                                                │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ connect                           Connect to an ECS Fargate container                                                                      │
│ exec-command                      Execute manage.py command with args                                                                      │
│ list-cluster                      List cluster into an AWS account                                                                         │
│ list-service                      List service(s) into a cluster                                                                           │
│ list-task                         List task(s) into a service into a cluster                                                               │
│ tail                              Tail logs of a selected  ECS container                                                                   │
| update-secret                     Update secret from secret manager                                                                        |
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

```

&nbsp;

Thanks to Typer from [@tiangolo](https://typer.tiangolo.com/)

Thanks to [@kraymer](https://github.com/kraymer) for echoprompt :sunglasses:

