InTouch Hub · Blue Isle Software

AWS Cost Watcher

Daily AWS spend summary by service with anomaly detection. AI flags unusual spikes, identifies which services drove yesterday's cost, and projects month-end totals.

AWS Cost Watcher Skill

Yesterday's AWS bill, every morning, with anomalies flagged before they surprise you at end of month.

The Problem

The AWS billing dashboard tells you what happened a week ago. By the time a runaway Lambda or a forgotten EC2 instance shows up in your monthly invoice, it has been burning money for 20+ days. A daily 30-second summary catches these in 1 day, not 30.

How It Works

A scheduled InTouch job runs every morning:

  1. A runtimeenv task runs the AWS CLI's ce get-cost-and-usage for yesterday plus the trailing 30 days, with your AWS credential injected as env vars
  2. The output JSON is passed to the aws-cost-watcher skill
  3. AI compares yesterday vs trailing average, flags anomalies, projects month-end
  4. The message task delivers the digest

Why runtimeenv and not the aws tool

InTouch's aws tool covers EC2, S3, Lambda, RDS, CloudWatch, etc. — but not Cost Explorer (ce). So this skill uses runtimeenv with the standard AWS CLI, which the runtime injects credentials into automatically.

Setup

  1. Install this skill
  2. Create an aws credential with at minimum ce:GetCostAndUsage permission
  3. Make sure a runtime env is installed that has the AWS CLI v2 on its PATH (or install it inside the runtimeenv first run)
  4. Use the YAML below; schedule for 8am daily

Example YAML Job

name: aws-cost-daily
version: 1.0.0
description: Daily AWS cost summary with anomaly flagging

notifications:
  - userNames: [intouch]
    alertOnError: true

tasks:
  - name: fetch-costs
    tool: runtimeenv
    properties:
      credentialNames: ["aws-readonly"]
      scriptContent: |
        #!/bin/bash
        set -euo pipefail
        END=$(date -u +%Y-%m-%d)
        YEST=$(date -u -d "yesterday" +%Y-%m-%d)
        START=$(date -u -d "30 days ago" +%Y-%m-%d)

        echo "=== YESTERDAY ($YEST) ==="
        aws ce get-cost-and-usage \
          --time-period Start=$YEST,End=$END \
          --granularity DAILY \
          --metrics UnblendedCost \
          --group-by Type=DIMENSION,Key=SERVICE

        echo "=== LAST 30 DAYS ==="
        aws ce get-cost-and-usage \
          --time-period Start=$START,End=$END \
          --granularity DAILY \
          --metrics UnblendedCost \
          --group-by Type=DIMENSION,Key=SERVICE

  - name: digest
    tool: skill
    properties:
      skillName: aws-cost-watcher
      input: |
        monthly_budget: 2500

        {{fetch-costs.output}}

  - name: send
    tool: message
    properties:
      subject: "AWS daily cost"
      body: "{{digest.answer}}"
      userNames: "intouch"

Customization

Cost

Roughly $0.75/month, vs the $100s an early-warning catch will save you.