Skip to main content

Single pane TUI for monitoring AWS ECS cluster health

Project description

Grapes

Warning This project is an experiment in AI-assisted development. The code was generated without human review and should not be trusted for production use. That said, Grapes is read-only and makes no modifications to your AWS resources, so there's no harm in trying it!

A single-pane TUI (Text User Interface) for monitoring AWS ECS cluster health. Built with Python and Textual.

Features

  • Cluster Selection: View all accessible ECS clusters and select one to monitor
  • Real-time Monitoring: View cluster, service, task, and container status at a glance
  • Health Indicators: Visual health status (✓ Healthy, ⚠ Warning, ✗ Unhealthy, ? Unknown)
  • Container Metrics: CPU and memory utilization from CloudWatch Container Insights
  • Deployment Tracking: See all deployments (PRIMARY, ACTIVE, etc.) with task definition versions
  • AWS Console Integration: One-key access to open resources in AWS Console
  • Keyboard Navigation: Fast, keyboard-driven interface
  • Dark Mode: Easy on the eyes for extended monitoring sessions

Requirements

  • Python 3.11+
  • AWS credentials configured (via environment, ~/.aws/credentials, or IAM role)
  • CloudWatch Container Insights enabled (optional, for CPU/memory metrics)

Installation

Install from PyPI:

pip install grapes-ecs

Or using uv:

uv tool install grapes-ecs

Then run:

grapes

Development Installation

# Clone the repository
git clone <repository-url>
cd grapes

# Install dependencies
uv sync

# Run the application
uv run grapes

Configuration

Create a config.toml file in your current directory or at ~/.config/grapes/config.toml:

[cluster]
name = "my-ecs-cluster"      # Optional: ECS cluster name (if omitted, select from list)
region = "us-east-1"         # Required: AWS region
profile = "default"          # Optional: AWS profile name

[refresh]
interval = 30                # Optional: API poll interval in seconds (default: 30)
task_definition_interval = 300  # Optional: Task def cache TTL in seconds (default: 300)

If you omit the name field, Grapes will show a list of all clusters in the region, and you can select one to view.

Run with a specific config file:

grapes -c /path/to/config.toml

Keyboard Shortcuts

Key Action
↓/↑ Navigate list
Enter Select cluster / View service details
Esc Go back (cluster list / service list)
O Open in AWS Console
R Force refresh data
D Toggle debug console
Q Quit

Required IAM Permissions

The following IAM permissions are required:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ecs:ListClusters",
        "ecs:DescribeClusters",
        "ecs:ListServices",
        "ecs:DescribeServices",
        "ecs:ListTasks",
        "ecs:DescribeTasks",
        "ecs:DescribeTaskDefinition"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "cloudwatch:GetMetricData",
        "cloudwatch:GetMetricStatistics"
      ],
      "Resource": "*"
    }
  ]
}

Enabling Container Insights

For CPU and memory metrics, enable Container Insights on your cluster:

aws ecs update-cluster-settings \
  --cluster my-cluster \
  --settings name=containerInsights,value=enabled \
  --region us-east-1

If Container Insights is not enabled, Grapes will display a warning and show - for metrics.

Health Status

Grapes determines health based on ECS container health checks:

  • ✓ Healthy: All containers report healthy
  • ⚠ Warning: Some containers unhealthy or desired != running count
  • ✗ Unhealthy: All containers unhealthy or no running tasks
  • ? Unknown: Health checks not configured

No fallback logic is used - only actual container health check results are displayed.

Metrics Display

When Container Insights is enabled:

  • CPU: Displayed as usage% / limit_units (e.g., 12% / 512)
  • Memory: Displayed as usedM / limitM (e.g., 256M / 1024M)

Metrics are fetched from CloudWatch and may have 1-2 minutes of lag. Missing or stale metrics are always shown as -.

Development

# Install dev dependencies
uv sync

# Run linting
uv run ruff check .

# Run tests
uv run pytest

License

MIT

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

grapes_ecs-0.1.0.tar.gz (70.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grapes_ecs-0.1.0-py3-none-any.whl (40.0 kB view details)

Uploaded Python 3

File details

Details for the file grapes_ecs-0.1.0.tar.gz.

File metadata

  • Download URL: grapes_ecs-0.1.0.tar.gz
  • Upload date:
  • Size: 70.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for grapes_ecs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8f94da43ce4bb6e65c9bc32afb3a23120d6fa31fde4d6e823d1d1e3de3be5295
MD5 f3fcd09d60c5c6db17db53eb66262245
BLAKE2b-256 9005234cd69b6320b3294b3ef9e854ec8891dfdcdc7c1254fae21adec4038e27

See more details on using hashes here.

File details

Details for the file grapes_ecs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: grapes_ecs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 40.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for grapes_ecs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5debaaeb05ce70bce32056a5d20a1c8d2e8f243efeddbec9033b33037b9b2745
MD5 86db303eedc92f9bc001535f38552557
BLAKE2b-256 589653dbca9b6941b45e8dc35aba728477b08413cc04d9d9c14c90aa974cdff4

See more details on using hashes here.

Supported by

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