Skip to content

Add ECS management source detection and improve container tracking - #86

Merged
strick-j merged 2 commits into
developfrom
claude/add-ecs-visualization-VK6jq
Feb 10, 2026
Merged

Add ECS management source detection and improve container tracking#86
strick-j merged 2 commits into
developfrom
claude/add-ecs-visualization-VK6jq

Conversation

@strick-j

Copy link
Copy Markdown
Owner

Summary

This PR enhances ECS container tracking by detecting and displaying the management source (Terraform, GitHub Actions, or unmanaged) for each container. It also adds a new ECS summary endpoint and improves the frontend UI with dedicated ECS list page and management badges.

Key Changes

Backend

  • Management Source Detection: Added managed_by field to ECSContainer model to track whether containers are managed by Terraform, GitHub Actions, or unmanaged
  • Image Tag Extraction: Extract and store container image tags separately for better visibility and management source detection
  • ECS Collector Enhancement: Implemented _detect_managed_by() method that identifies CI/CD deployments based on:
    • Image tag patterns (git SHAs, semver tags)
    • Resource tags (deployed-by, managed-by)
  • New ECS Summary Endpoint: Added /ecs/summary endpoint returning cluster count, task counts by status, and total tasks
  • Topology Improvements: Updated topology view to include all ECS containers (not just Terraform-managed) with proper management source display
  • Database Schema: Added image_tag and managed_by columns to ECSContainer table

Frontend

  • ECS List Page: New dedicated page for viewing ECS containers and clusters with filtering and detail panels
  • Management Badge Component: New ManagedByBadge component replacing TerraformBadge with support for:
    • Terraform (purple badge with Terraform icon)
    • GitHub Actions (green badge with GitHub icon)
    • Unmanaged (gray badge with help icon)
  • Dashboard Widget: Added ECS summary card showing cluster count and task status breakdown
  • Detail Panel Updates: Enhanced ECS container detail panel to display image tag and management source
  • Topology Visualization: Updated ECS container nodes to show management source (TF/GHA badges)
  • Type Definitions: Added ManagedBy type and updated all ECS-related interfaces

Infrastructure

  • IAM Permissions: Added ECS read-only permissions to monitoring role for proper resource discovery

Implementation Details

  • Management source detection prioritizes Terraform flag over stored managed_by value for backward compatibility
  • Image tag extraction handles standard Docker image format (image:tag)
  • CI/CD pattern matching includes full/short git SHAs and semantic versioning
  • Topology view now includes both Terraform-managed and CI/CD-deployed containers for complete infrastructure visibility
  • All changes maintain backward compatibility with existing Terraform-managed container tracking

https://claude.ai/code/session_016ZmpvrW3h5SFZ3LGyRPXCr

Implements full ECS container visualization with a new "managed by" concept
that supports multiple management sources (Terraform, GitHub Actions, unmanaged).

Backend changes:
- Add ManagedBy enum and managed_by field to ECS schemas and database model
- Add image_tag field to ECSContainer for CI/CD deployment detection
- Add management source detection in ECS collector using image tag patterns
  (git SHA, semver) and resource tags (deployed-by, managed-by)
- Add /ecs/summary API endpoint for dashboard counts
- Update topology endpoint to include all ECS containers (not just TF-managed)
  with managed_by field
- Update resource sync to persist managed_by and image_tag fields
- Add ECS read permissions to IAM task role policy

Frontend changes:
- Create ManagedByBadge component with Terraform/GitHub Actions/Unmanaged states
- Add ManagedBy type and ECSSummaryResponse to TypeScript types
- Update ECS list page and detail panels to use ManagedByBadge
- Add ECS Containers entry to sidebar navigation
- Add /ecs route to App.tsx router
- Add ECS summary card to dashboard with cluster/task counts
- Update topology ECS node to show TF/GHA badge based on managed_by
- Add useECSSummary hook and getECSSummary API function

https://claude.ai/code/session_016ZmpvrW3h5SFZ3LGyRPXCr
@github-actions

github-actions Bot commented Feb 10, 2026

Copy link
Copy Markdown

🐳 Docker Build Results

Image Status Tag
Backend ✅ success pr-86
Frontend ✅ success pr-86

Note: Images are pushed to the dev ECR on merge to develop and to the prod ECR on merge to main.
To push from this PR, use the workflow dispatch with push_to_ecr: true.

- Add ECSListPage mock to App.test.tsx vi.mock("@/pages")
- Add useECSSummary mock to Dashboard.test.tsx vi.mock("@/hooks")
- Fix Prettier formatting in ManagedByBadge.tsx

https://claude.ai/code/session_016ZmpvrW3h5SFZ3LGyRPXCr
@strick-j
strick-j merged commit 9cd794a into develop Feb 10, 2026
36 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants