PollyHub

AWS Cost Report

Clean

Generate comprehensive daily AWS cost analysis reports with styled HTML templates.

SKILL.md

---
name: "AWS Cost Report"
description: Generate comprehensive daily AWS cost analysis reports with styled HTML templates. Use when asked to monitor AWS spending, analyze cost spikes, or setup recurring email reports for AWS accounts.
metadata:
  openclaw:
    requires:
      env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"]
---

# AWS Cost Report

This skill generates a detailed, styled HTML report of AWS spending over the last 30 days using the Cost Explorer API.

## Authentication

The skill requires AWS credentials with access to the Cost Explorer API (`ce:*`) and basic identity info (`sts:GetCallerIdentity`).

1. **Environmental configuration**:
   Set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` via:
   `manage_skills(action="config", skill_name="aws-cost-report", env={"AWS_ACCESS_KEY_ID": "...", "AWS_SECRET_ACCESS_KEY": "..."})`

2. **Required Permissions**:
   The IAM user must have the following policy:
   - `ce:GetCostAndUsage` (Essential)
   - `ce:GetDimensionValues`
   - `sts:GetCallerIdentity`
   - `ce:GetCostForecast` (Optional - fallback to manual projection if denied)

## Standard Workflow

### 1. Data Retrieval
Use `boto3` to pull data for the last 30 days:
- **Daily Spend**: Granularity `DAILY`, Metrics `UnblendedCost`.
- **Top Services**: Granularity `MONTHLY`, Group by `SERVICE`.
- **Regional Split**: Granularity `MONTHLY`, Group by `REGION`.

### 2. Report Generation
Apply data to the bundled HTML template in `assets/report_template.html`. 
- **Anomaly Detection**: Flag any day exceeding 2x the rolling average.
- **MoM Comparison**: Compare current month-to-date with the previous period.

### 3. Delivery
Send the finished HTML via `send_gmail_message` with `body_format="html"`.

## Recurring Task Setup

To setup a daily report, create a recurring task with the following instruction pattern:
"Execute the aws-cost-report workflow daily at 11am PST and email the HTML result to [email]."

## Resources

- **Template**: [assets/report_template.html](assets/report_template.html) - Base structure for the HTML report.
Authorhxie
Downloads2
Versions1
Published11d ago

Version History

v1.1.0latest

Initial release with official naming and HTML template.

Mar 30, 2026

Clean.zip

SHA-256 (latest)

4f021ed11f27e1914084e0611583fb0a5bf624e11f6e3171a331dd1aa68c8854