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.2.0.tar.gz (77.0 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.2.0-py3-none-any.whl (46.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grapes_ecs-0.2.0.tar.gz
  • Upload date:
  • Size: 77.0 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.2.0.tar.gz
Algorithm Hash digest
SHA256 690ec71857c667ff68e0b818197950cb0681aacad980db6dcb39ca3cffa9cfe4
MD5 3ca04cbe5f164b17ba9732735ced5b67
BLAKE2b-256 b17b0d738a6c1ed056d767fa9bb28de40426b63da5b937e8d241078828cf1851

See more details on using hashes here.

File details

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

File metadata

  • Download URL: grapes_ecs-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 46.1 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7227925654ed498dfe4a0769c62fc0e41358abe19b660128fac3d70a1b4f2942
MD5 b5c73e78013e3cb2817b6cba77016389
BLAKE2b-256 d39b70f046ad8162879205706870a02b07f9825d88c20014ce221dbb1cf78c75

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