Skip to main content

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

Metadata

Release files for aws-excom 0.0.20

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

Source distribution (sdist)

Source distribution for aws-excom 0.0.20
File Size Uploaded
aws-excom-0.0.20.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aws-excom 0.0.20
File Interpreter ABI Platform
aws_excom-0.0.20-py3-none-any.whl Python 3 none any Details

Total release size: 16.9 kB

Release files / aws-excom-0.0.20.tar.gz

Download URL aws-excom-0.0.20.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
12474357127c9eb99b2acdbdf8bb3c37f0dfe489855d9b0fac084566c86a5823
BLAKE2b-256 checksum
How to use checksums
20bee3153027ff0c30939161f92227a997310da764a8a7a3cce73d3b1a9d808b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.2

Release files / aws_excom-0.0.20-py3-none-any.whl

Download URL aws_excom-0.0.20-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76c960bb05fae18c97483dd9133bf511650b605c7c6d376af30702b7b82d0924
BLAKE2b-256 checksum
How to use checksums
401b63939c98baddf714942d68afa52b084738dd965cd0aad8ae89e8b372f58b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.2

Release history Release notifications | RSS feed

This release

0.0.20 This release

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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