Skip to main content

Wrapper for AWS ECS Execute Command

Project description

aws-excom

An interactive wrapper around aws ecs execute-command.

Installation

Requires AWS CLI and AWS CLI Session Manager to be installed on the system and configured with appropriate credentials.

Then, to install the script:

pip install aws-excom

Usage

aws-excom

Then follow the prompts to start running commands.

After running once, you can run:

aws-excom --last

to skip the interactive part of the script and immediately replay the last command you constructed. This may be useful if you accidentally exit a running session.

By default, all AWS commands will use your default profile and region. To override these, pass the following arguments:

aws-excom --profile foo --region us-east-1

By default you'll be given an interactive prompt to enter the command to execute. To skip this, you may optionally provide a '--command' argument eg.:

aws-excom --command "python3"

This is handy for writing aliases for common commands:

# File: aws-excom-django-python-shell.sh

#!/bin/sh
aws-excom --command "python3 manage.py shell" "$@"

Local Development

Before installing the package in development mode, you may find it convenient to create a virtual environment in which to install dependencies. The recommended way of doing this is using Python's built-in venv module:

# Create a directory for your environments if you don't have one already
mkdir ~/.venv  

# Your environment can have any name
python -m venv ~/.venv/my-aws-excom-env  

Next you need to activate the environment in your shell:

source ~/.venv/my-aws-excom-env/bin/activate

Now you're ready to install the package and its dependencies:

cd aws-excom

# -e: Editable mode
pip install -e .

You can verify this has worked by running:

which aws-excom

This prints the location of the main script installed by the package, which should be inside your virtual environment: ~/.venv/my-aws-excom-env/aws-excom/bin/aws-excom.

Now, running aws-excom in your shell will use the code you have locally. Any changes you make to source files will be automatically used when you next run the command.

Other Python Versions

To test the package against different Python versions, first ensure that any required versions are installed. They should be accessible using python3.8 / python3.7 or similar.

Now you can simply create a suitable virtual environment using this Python version:

# Your environment can have any name
python3.8 -m venv ~/.venv/my-py38-aws-excom-env  

After activating the environment, you can verify the environment contains the Python version you've chosen using:

python --version

Inside this environment aws-excom will now run using this Python version.

Testing

Install the optional development tools for testing and linting:

pip install -e .[dev]

Run the test suite using:

pytest

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

aws-excom-0.0.20.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

aws_excom-0.0.20-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file aws-excom-0.0.20.tar.gz.

File metadata

  • Download URL: aws-excom-0.0.20.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for aws-excom-0.0.20.tar.gz
Algorithm Hash digest
SHA256 12474357127c9eb99b2acdbdf8bb3c37f0dfe489855d9b0fac084566c86a5823
MD5 e0e4480625eaa26e34321913d10ba432
BLAKE2b-256 20bee3153027ff0c30939161f92227a997310da764a8a7a3cce73d3b1a9d808b

See more details on using hashes here.

File details

Details for the file aws_excom-0.0.20-py3-none-any.whl.

File metadata

  • Download URL: aws_excom-0.0.20-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for aws_excom-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 76c960bb05fae18c97483dd9133bf511650b605c7c6d376af30702b7b82d0924
MD5 d2549b0f7f0d89a056e537ba884da650
BLAKE2b-256 401b63939c98baddf714942d68afa52b084738dd965cd0aad8ae89e8b372f58b

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