Skip to main content

ECS Tasks Ops

PyPI Python Version License

Read the documentation at https://ecs-tasks-ops.readthedocs.io/ Tests Codecov

pre-commit Black

Features

  • Application GUI to manage ECS resources

  • Use your home aws credentials from ~/.aws/credentials

  • Get information and attributes for each task, service or instance container

  • Connect through SSH to container instances or docker container

  • Show logs for each docker container

  • Show ECS events for a service

  • Force restart for a service

Requirements

Installation

You can install Ecs Tasks Ops via pip from PyPI:

$ pip install ecs-tasks-ops

Configuration

AWS Access

This application uses your aws credentials to connect to your ECS, so you need to configure your credentials.

Set up credentials (in e.g. ~/.aws/credentials)

[default]
aws_access_key_id = YOUR_KEY
aws_secret_access_key = YOUR_SECRET

Then, you set up a default region (in e.g. ~/.aws/config)

[default]
region=us-east-1

You can read more about it in boto3

ssh over ssm

If you want to access to containers instances or docker container through ssh, you must configurate ssm in your EC2 machines. That’s because ecs-tasks-ops use its instance id as machine identifier on ssh command. For example, ssh i-0123456789ABCDE. I use ssh-over-ssm tool to configure ssh over ssm to connect to instances.

Predefined Commands

You can set multiples predefined commands to execute on docker containers. You can set them in a configuration file called ecs-tasks-ops.json. This file can be located on ~, ~/.config/ecs-tasks-ops, /etc/ecs-tasks-ops, or any directory configured in the enviromental variable ECS_TASKS_OPS_CONF

Sample configuration

{
   "commands": [
      "/bin/sh",
      "/bin/bash",
      "mongo admin -u root -p $(pass mongo/root)"
   ]
}

GUI Usage

You can open the qt5 application, using the following command

ecs-tasks-ops-qt5

CLI Usage

You can open the command line with ecs-tasks-ops command. This is the help menu:

Usage: ecs-tasks-ops [OPTIONS] COMMAND [ARGS]...

   Ecs Tasks Ops.

Options:
   -x, --debug / --no-debug
   -j, --output-json
   --version                 Show the version and exit.
   --help                    Show this message and exit.

Commands:
   clusters             Clusters information.
   container-instances  Container instances defined in a cluster.
   containers           Get docker containers defined in a cluster.
   services             Services defined in a cluster.
   tasks                Set tasks defined in a cluster.

By default, the output format is in a table, but you can get original json format with -j option. You can filter json output with jq tool:

$ ecs-tasks-ops -j clusters | jq "."

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the MIT license, Ecs Tasks Ops is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This project was generated from @cjolowicz’s Hypermodern Python Cookiecutter template.

Release files for ecs-tasks-ops 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecs-tasks-ops 1.0.0
File Size Uploaded
ecs_tasks_ops-1.0.0.tar.gz 143.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ecs-tasks-ops 1.0.0
File Interpreter ABI Platform
ecs_tasks_ops-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 293.5 kB

Release files / ecs_tasks_ops-1.0.0.tar.gz

Download URL ecs_tasks_ops-1.0.0.tar.gz
Size 143.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b12765de1c2d07f08926efa8d6449fe3b732b0e82e72e76b57b6a756c2ff759a
BLAKE2b-256 checksum
How to use checksums
65e08276dfb2d51149f337c9178b79c6c08502c360b44b07af0fa0830cd46652
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.3 Linux/6.3.9-zen1-1-zen

Release files / ecs_tasks_ops-1.0.0-py3-none-any.whl

Download URL ecs_tasks_ops-1.0.0-py3-none-any.whl
Size 150.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50d97d765e956a1365f0cdba97e3719f710502528360965ab211a31a180b941d
BLAKE2b-256 checksum
How to use checksums
0663e581ce73a77e60279f678ddd79a58c579c7aa75d147d284e3ca4159a596f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.3 Linux/6.3.9-zen1-1-zen

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page