Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions custom-agents/eos-cost-analysis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

## 1.0.0 (2026-06-18)

- Initial release
- Support for 5 services: EKS, RDS/Aurora, Lambda, ElastiCache, OpenSearch
- Extended Support cost calculation with Year 1/2/3 tiered pricing
- Single-account and organization-wide (cross-account) analysis
- EOS date and pricing validation via aws-knowledge-mcp-server
- CSV artifact generation with per-resource cost breakdown
- Upgrade recommendations with AWS documentation links
- Lambda deprecated runtime flagging (security risk, no ES cost)
71 changes: 71 additions & 0 deletions custom-agents/eos-cost-analysis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# EOS Cost Analysis — Custom Agent

## Purpose

A dedicated custom agent that discovers AWS resources approaching or past End of Standard Support and calculates the Extended Support cost impact. Use this when you want automated, scheduled EOS posture reports without manual prompting.

> **Note:** For ad-hoc queries, you don't need this custom agent. Just upload the [eos-cost-analysis skill](../../skills/eos-cost-analysis/) and ask questions in regular Chat. This custom agent is for scheduled/automated runs.

## Key Capabilities

- Runs on demand or on a weekly/monthly schedule
- Discovers resources across all associated accounts automatically
- Produces a persisted artifact (report) each run for tracking over time
- Covers EKS, RDS/Aurora, Lambda, ElastiCache, and OpenSearch
- Calculates per-resource Extended Support cost with Year 1/2/3 pricing tiers

## Prerequisites

- An AWS DevOps Agent space
- The [eos-cost-analysis skill](../../skills/eos-cost-analysis/) uploaded to your Agent Space (choose "All agents" for Agent Type)
- `use_aws` and `verify_aws_claim` tools available in the Agent Space
- IAM permissions for resource discovery:
- `eks:ListClusters`, `eks:DescribeCluster`
- `rds:DescribeDBInstances`, `rds:DescribeDBClusters`
- `lambda:ListFunctions`
- `elasticache:DescribeCacheClusters`
- `opensearch:ListDomainNames`, `opensearch:DescribeDomains`
- For multi-account analysis: associate secondary accounts in DevOps Agent settings

## Creating the Agent

1. In the DevOps Agent web app, go to the "Agents" menu (on the bottom left pane)
2. Click "Create agent" (on the right side), then click "Form" (the left-most option)
3. In the "Name" field, use "eos-cost-analysis"
4. Copy the content of the `SYSTEM_PROMPT.md` file from this directory, and paste it into the "System prompt" field
5. In the "Skills" drop-down list, select the "eos-cost-analysis" skill, and click "Create agent"
6. Add the `use_aws` tool — in the custom agent's window, click "Edit", select "Chat", and type "Add the use_aws tool to this custom agent"
7. Add the `verify_aws_claim` tool — type "Also add the verify_aws_claim tool"
8. Verify both tools appear under "Tools" for this custom agent

## Executing the Agent

You can execute the custom agent on-demand, on schedule, or using chat. Follow the [Executing custom agents guide](https://docs.aws.amazon.com/devopsagent/latest/userguide/custom-agents-executing-custom-agents.html) for more information.

**On-demand prompts:**
- "Run this agent now" (uses default — full EOS analysis across all services and accounts)
- "Analyze EKS EOS only in us-east-1 and eu-west-1"
- "Check RDS extended support costs for the last quarter"

**Scheduled runs:**
- Configure weekly or monthly execution under the agent's schedule settings
- Each run produces a new artifact version, allowing week-over-week comparison

Once finished, the artifact is persisted on the **Artifacts** page in the DevOps Agent web app.

## Multi-Account Setup

For organization-wide analysis across multiple AWS accounts:

1. In DevOps Agent, go to Settings → Cloud Sources
2. Click "Add secondary cloud source"
3. Follow the prompts to create a cross-account role in each secondary account
4. After association, the agent automatically discovers resources across all connected accounts

No additional configuration needed in the skill or agent — DevOps Agent handles cross-account access transparently.

## Related

- [eos-cost-analysis skill](../../skills/eos-cost-analysis/) — the domain knowledge skill this agent uses (also works standalone in Chat)
- [aws-health-events skill](../../skills/aws-health-events/) — for correlating with Health Dashboard deprecation events
- [AWS DevOps Agent custom agents documentation](https://docs.aws.amazon.com/devopsagent/latest/userguide/working-with-devops-agent-custom-agents-index.html)
44 changes: 44 additions & 0 deletions custom-agents/eos-cost-analysis/SYSTEM_PROMPT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
You are an EOS Cost Analyzer — a specialized agent that discovers AWS resources approaching or past End of Standard Support and calculates the financial impact of Extended Support charges across an AWS environment.

## Goal

Identify all resources incurring or approaching Extended Support charges, calculate the per-resource and organization-wide cost impact, and provide actionable upgrade recommendations with AWS documentation references.

## Approach

1. Read the `eos-cost-analysis` skill to load the methodology, discovery procedures, and cost calculation formulas.
2. Determine scope: which service(s), which regions. Always scan ALL associated accounts by default unless the user explicitly restricts to a specific account.
3. Discover resources using AWS service APIs via `use_aws`.
4. Validate EOS dates and Extended Support pricing against AWS documentation using available verification tools.
5. Classify each resource by EOS status and calculate its monthly Extended Support cost.
6. Generate a structured report with per-resource breakdown, urgency levels, and upgrade recommendations.
7. Produce a CSV artifact with the complete resource inventory and cost analysis.

## Constraints

- Read-only — do not modify, upgrade, or delete any resources.
- Never guess EOS dates or pricing. Always verify from AWS documentation. If a date or rate cannot be confirmed, report it as "UNVERIFIED" or "PRICING_UNAVAILABLE".
- Extended Support pricing escalates yearly: Year 1 = base rate, Year 2 = 2×, Year 3 = 3×. Always determine which pricing year applies.
- For RDS Multi-AZ instances, Extended Support is billed on both primary and standby — multiply cost by 2.
- If cross-account role assumption fails for any account, skip it and note it in the report rather than stopping the entire analysis.
- All output is AI-generated and must be independently verified before taking action or sharing externally.

## Output

Produce a single artifact titled "EOS Cost Impact Report — [date]" containing:

1. **Executive Summary** — Total monthly/annual Extended Support cost, affected resource count, top impacted accounts.
2. **Cost Breakdown by Service** — Per-service totals with resource counts.
3. **Resource Detail Table** — Every affected resource with: ARN, version, EOS status, monthly cost, urgency, recommended upgrade target.
4. **Upgrade Recommendations** — Per-version migration path with AWS documentation links.
5. **Security Risk** (if applicable) — Deprecated Lambda runtimes flagged separately (no ES cost, but security risk).

If an EOS Cost Impact Report artifact already exists for the same scope, update it with the latest data instead of creating a new one.

## Notifications

After generating the report, attempt to send a summary notification via Slack or any available communication tool:
- Try to post a message to the configured Slack channel with: total monthly ES cost, number of CRITICAL resources, top impacted account and service
- If Slack posting succeeds: note "Notification sent to Slack" in the report
- If Slack posting fails or no communication tool is available: note "Notification skipped — no communication tool available or posting failed" in the report
- Do not send a notification if no resources are affected (all supported)
14 changes: 14 additions & 0 deletions skills/eos-cost-analysis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

## 1.0.0 (2026-06-18)

- Initial release
- 5-phase workflow: Scope → Discover → Classify → Calculate → Report
- Service support: EKS, RDS/Aurora, Lambda, ElastiCache, OpenSearch
- EOS status classification: IN_EXTENDED_SUPPORT, APPROACHING_EOS, PAST_EXTENDED_SUPPORT
- Cost calculation with per-vCPU (RDS), per-cluster (EKS), per-node (ElastiCache/OpenSearch) formulas
- Multi-AZ cost doubling for RDS
- Year 1/2/3 pricing escalation
- Cross-account discovery via sts:AssumeRole
- Documentation validation via aws-knowledge-mcp-server
- CSV artifact output with upgrade recommendations
77 changes: 77 additions & 0 deletions skills/eos-cost-analysis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# EOS Cost Analysis — Skill

## Purpose

Discovers AWS resources approaching or past End of Standard Support and calculates the Extended Support cost impact across your AWS environment. Covers EKS, RDS/Aurora, Lambda, ElastiCache, and OpenSearch — the services that incur Extended Support charges.

## Key Capabilities

- Discovers resources with deprecated versions across 5 AWS services (multi-account supported)
- Validates EOS dates and Extended Support pricing against live AWS documentation
- Calculates per-resource monthly cost with Year 1/2/3 tiered pricing escalation
- Handles RDS Multi-AZ cost doubling and instance class to vCPU mapping
- Flags deprecated Lambda runtimes as security risk (no ES charge but patching stops)
- Produces a structured report with per-resource breakdown, urgency levels, and upgrade recommendations

## Usage Options

### Option 1: Ad-Hoc via Regular Chat

Upload the skill and use it directly in the built-in DevOps Agent chat for on-demand analysis.

**Setup:**
1. Import the skill (choose "All agents" for Agent Type)
2. Go to the regular Chat interface
3. Ask any EOS-related question

**Example prompts:**
- "What's my EOS cost exposure?"
- "Check which EKS clusters are in Extended Support"
- "Full EOS analysis across all services and accounts"
- "What RDS instances are approaching end of support?"

### Option 2: Dedicated Custom Agent (Scheduled/Automated)

Create a custom agent for scheduled runs that produce reports on a weekly or monthly cadence — no human prompt needed.

**Setup:**
1. Import the skill (choose "All agents" for Agent Type)
2. Go to Agents → Create agent → Form
3. Name: `eos-cost-analysis`
4. System prompt: paste from [SYSTEM_PROMPT.md](../../custom-agents/eos-cost-analysis/SYSTEM_PROMPT.md)
5. Skills: select `eos-cost-analysis`
6. Add tools: `use_aws` and `verify_aws_claim`
7. Configure a schedule (weekly or monthly) under the agent's settings

**When to use this option:**
- You want automated, recurring EOS posture reports
- You want artifacts generated without manual prompting
- You want to track EOS cost drift over time (compare reports week over week)

## Prerequisites

- AWS DevOps Agent space with `use_aws` and `verify_aws_claim` tools available
- IAM permissions for resource discovery:
- `eks:ListClusters`, `eks:DescribeCluster`
- `rds:DescribeDBInstances`, `rds:DescribeDBClusters`
- `lambda:ListFunctions`
- `elasticache:DescribeCacheClusters`
- `opensearch:ListDomainNames`, `opensearch:DescribeDomains`
- For multi-account analysis: associate secondary accounts in DevOps Agent settings
- AWS Support plan: Business, Enterprise On-Ramp, or Enterprise (required for DevOps Agent)

## Importing the Skill

1. In the DevOps Agent web app, go to "Skills" (left sidebar)
2. Click "Import skill"
3. Upload the zip file containing `SKILL.md`
4. In "Agent Type" field: select **"All agents"**
5. Click "Import"

## Related

- [eos-cost-analysis custom agent](../../custom-agents/eos-cost-analysis/) — system prompt and setup guide for the dedicated agent
- [aws-health-events skill](../aws-health-events/) — for correlating with Health Dashboard deprecation notifications
- [eks-operation-review skill](../eks-operation-review/) — comprehensive EKS operational review (broader than EOS)
- [AWS EKS Version Lifecycle](https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html)
- [Amazon RDS Extended Support](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html)
Loading