Skip to main content

lazy-ecs

PyPI version Python versions License Coverage Status

A CLI tool for navigating AWS ECS clusters interactively.

lazy-ecs demo

Why I Built This

When running services in ECS, I constantly needed to check:

  • What exactly is running where?
  • Is my service healthy?
  • What parameters or environment variables got applied?
  • What do the latest logs show - did the container start as expected?

The AWS ECS web console is confusing to navigate, with multiple clicks through different screens just to get basic information. The AWS CLI is powerful but verbose and requires memorizing complex commands.

lazy-ecs solves this with a simple, interactive CLI that lets you quickly drill down from clusters → services → tasks → containers with just arrow keys. It destroys the AWS CLI in usability for ECS exploration and debugging.

Table of Contents

Features

Navigation & Exploration

Interactive cluster selection

  • Arrow key navigation through ECS clusters
  • Why it's great: AWS console requires multiple clicks through menus; AWS CLI requires memorizing cluster ARNs

Service browsing with smart status indicators

  • Visual health indicators (✅ healthy, ⚠️ scaling, 🔴 over-scaled)
  • Running/desired/pending task counts at a glance
  • Why it's great: AWS console hides task counts in separate tabs; requires mental math to determine service health

Service Status

Open in AWS console

  • One-key shortcut to open current resource in browser
  • Works for clusters, services, and tasks
  • Why it's great: When you need the full AWS console, jump there instantly without manual navigation

Container Inspection

Container details

  • Name, image, CPU/memory configuration
  • Environment variables and secrets (without exposing values)
  • Port mappings and volume mounts
  • Why it's great: AWS console spreads this across multiple tabs; AWS CLI requires complex JSON parsing

Log viewing with live tail

  • Display recent logs with timestamps
  • Real-time streaming (tail -f style)
  • CloudWatch filter patterns (include/exclude)
  • Why it's great: AWS console log viewer is slow and clunky; AWS CLI requires memorizing log group names and complex filter syntax

Service & Task Debugging

Force new deployment

  • Trigger service redeployment directly from CLI
  • Why it's great: AWS console requires navigating to service → Update → Force new deployment (3+ clicks)

Service events

  • Display deployment events with chronological sorting
  • Proper event categorization
  • Why it's great: AWS console shows events in reverse chronological order, making it hard to follow deployment progression

Task events/history with smart analysis

  • Lifecycle events and failure reasons
  • Automatic detection of common failures (OOM kills, timeouts, image pull failures)
  • Shows desired vs actual task definition versions (spot outdated tasks immediately)
  • Why it's great: AWS console requires clicking into each failed task individually; no smart analysis of failure patterns; no easy way to spot version mismatches

Task History

CloudWatch metrics

  • CPU/Memory utilization with current, average, and peak values
  • Why it's great: AWS console requires switching to CloudWatch tab, selecting metrics, configuring graphs

CloudWatch Metrics

Log group discovery

  • Automatically find relevant log groups for debugging
  • Why it's great: AWS console requires knowing the exact log group name; AWS CLI requires listing all log groups and filtering manually

Task definition comparison

  • Compare any two task definition revisions side-by-side
  • Interactive revision selection from recent history
  • Color-coded diff showing images, environment variables, secrets, CPU/memory, ports, commands, entrypoints, and volume mounts
  • Why it's great: AWS console has no native comparison tool; developers must download JSON and use external diff tools to answer "what changed between versions?"

Task Definition Comparison

Installation

Homebrew

# Add the tap
brew tap vertti/lazy-ecs

# Install lazy-ecs
brew install lazy-ecs

# Run it
lazy-ecs

pipx / uv / mise

Install in an isolated environment using your preferred tool manager:

# Using pipx
pipx install lazy-ecs

# Using uv
uv tool install lazy-ecs

# Using mise
mise use pipx:lazy-ecs

# Run it
lazy-ecs

Docker

Run lazy-ecs using Docker without installing Python:

# With aws-vault (temporary credentials)
aws-vault exec your-profile -- docker run -it --rm \
  -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN -e AWS_REGION \
  vertti/lazy-ecs

# With IAM credentials (long-lived)
docker run -it --rm \
  -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_REGION \
  vertti/lazy-ecs

# With AWS credentials file
docker run -it --rm -v ~/.aws:/home/lazyecs/.aws:ro vertti/lazy-ecs

# With specific profile
docker run -it --rm -v ~/.aws:/home/lazyecs/.aws:ro -e AWS_PROFILE=your-profile vertti/lazy-ecs

Pro tip: Create an alias for easier usage:

# Add to your ~/.bashrc or ~/.zshrc
alias lazy-ecs-docker='docker run -it --rm -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN -e AWS_REGION vertti/lazy-ecs'

# Then use with aws-vault
aws-vault exec your-profile -- lazy-ecs-docker

From Source

# Clone and install with uv
git clone https://github.com/vertti/lazy-ecs.git
cd lazy-ecs
uv sync
uv run lazy-ecs

AWS Authentication

lazy-ecs supports multiple ways to authenticate with AWS:

1. AWS Profile (--profile flag)

lazy-ecs --profile your-profile-name

2. Environment Variables

export AWS_DEFAULT_PROFILE=your-profile-name
lazy-ecs

3. AWS Vault

aws-vault exec Platform-Test.AWSAdministratorAccess -- lazy-ecs

4. Default Credentials Chain

lazy-ecs will automatically use the standard AWS credentials chain:

  • Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
  • AWS credentials file (~/.aws/credentials)
  • IAM instance profile (when running on EC2)

Roadmap

Features listed in priority order (by ROI - implementation effort vs. usage frequency):

  • Health check configuration - Display health check settings and current status
  • Export container environment - Save environment variables to .env file
  • Export task definition - Save task definitions as JSON/YAML files
  • Download logs to file - Export CloudWatch logs for offline analysis
  • Load balancer health - Display target group health and routing
  • Resource usage vs limits - Show allocated vs actual CPU/memory with right-sizing recommendations
  • Service update (image tag) - Deploy new image version from CLI
  • Service update (environment) - Update environment variables
  • Security groups - Display networking and security configuration
  • Auto-scaling configuration - Display scaling policies and current metrics
  • Task placement details - Display placement constraints and actual host placement
  • Port forwarding - Direct local connection to container ports
  • Service deployment history - Timeline of deployments with rollback options
  • Sparkline visualization - Unicode trend indicators for metrics
  • Multi-region support - Work with ECS across AWS regions
  • Multi-cluster support - Compare resources across clusters

Development

Prerequisites

Install tools with mise:

mise install

Setup

# Install dependencies
uv sync

# Install pre-commit hooks (runs ruff formatting/linting on commit)
uv run pre-commit install

Development Commands

# Run the CLI
uv run lazy-ecs

# Run tests
uv run pytest

# Format and lint code (with type annotation enforcement)
uv run ruff format
uv run ruff check --fix

# Type checking with pyrefly
uv run pyrefly check

# Auto-add missing type annotations
uv run pyrefly infer

# Run tests with coverage
uv run pytest --cov

See CLAUDE.md for detailed development guidelines.

Metadata

Release files for lazy-ecs 0.9.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 lazy-ecs 0.9.0
File Size Uploaded
lazy_ecs-0.9.0.tar.gz 620.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lazy-ecs 0.9.0
File Interpreter ABI Platform
lazy_ecs-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 665.0 kB

Release files / lazy_ecs-0.9.0.tar.gz

Download URL lazy_ecs-0.9.0.tar.gz
Size 620.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a79638bb5914d8275933849692597ad4bf2fcc188cd263f639ad8a608939d30b
BLAKE2b-256 checksum
How to use checksums
be9b3c816d09b6dfab7298d53ddb76c3921c0575ee6b3ad099335b2e5bd056c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lazy_ecs-0.9.0-py3-none-any.whl

Download URL lazy_ecs-0.9.0-py3-none-any.whl
Size 44.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9033b2f01b42ad5255ea611b2fbedc31f7b26f047d3c543cbdb2e2ed1852340a
BLAKE2b-256 checksum
How to use checksums
e38091eb725d2e1823afcc1131a20940e6b121dddc15c86fa8d0330d26109c54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.0

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.0

2 release files

0.5.0

2 release files

0.4.0

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.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.4

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