Skip to main content

Ecs Tasks Ops

Project description

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.

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

ecs-tasks-ops-0.3.4.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

ecs_tasks_ops-0.3.4-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file ecs-tasks-ops-0.3.4.tar.gz.

File metadata

  • Download URL: ecs-tasks-ops-0.3.4.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ecs-tasks-ops-0.3.4.tar.gz
Algorithm Hash digest
SHA256 53b000235e0fde72587ce9c7598be1a1d1f753ddd32ebe19032263f48f2ea238
MD5 0b54752f1bbcf18cd0d23d1fde9a62de
BLAKE2b-256 6c0cef462975d4ab894d3750dc47b2891e753d03d31a82505bec6a7b8b24889c

See more details on using hashes here.

File details

Details for the file ecs_tasks_ops-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: ecs_tasks_ops-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ecs_tasks_ops-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0a1295e0210c4fed1b4b9829ffd211da2bd2c45cea8c6e658eff7763cf27a587
MD5 ae182961ebfa2842b2a68296eba5e587
BLAKE2b-256 968abe1a80909093cc7f04fbe77dc15197daca634bcd53b94f633f12ec0ca3aa

See more details on using hashes here.

Supported by

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