Dawnfix

What did that deploy do to the AWS bill?

Works with AWS Cost Explorer GitHub ActionsGitHub Actions GitHubGitHub

Dawnfix Receipt compares AWS Cost Explorer's daily cost before and after each production deploy and keeps one comment on the PR or commit up to date, where the change was reviewed: the $/day change and what drove it, down to the usage type. It runs in your own GitHub Actions with a role that can only read Cost Explorer. Free and source available.

A production deploy's AWS cost is compared, three days before against three days after, and what moved is posted as one comment on the pull request: plus 40 dollars a day, mostly NAT Gateway data processing. A production deploy abc1234 · 20 Oct, 14:03 UTC Cost before and after 3 days each side · Cost Explorer, read-only What moved NAT Gateway data processing +$35.10/day One comment on the PR +$40.07/day (+305%) · kept up to date
The sample: a deploy that added $40.07 a day, shown on the PR where it was reviewed. Correlation, not causation.

How it works

  • On every successful production deploy (deployment_status), dawnfix-receipt.yml posts the comment. Cost Explorer lags about a day, so the first comment says "waiting for data".
  • Every day it re-runs the deploys of the last five days, and the same comment fills in, provisional until every day after the deploy has settled, then final.
  • Cost: Cost Explorer charges $0.01 per request; one deploy is one request a day while it is provisional, and none once a settled answer is cached. Each comment states how many it made.
  • Noise: a change smaller than the larger of $1/day, 3% of the baseline and twice its day-to-day spread is "no material change". Credits and refunds are excluded. Correlation, not causation: traffic moves cost too, and the comment says so.
  • Why not AWS's own anomaly detection: that starts from an anomaly and explains spend. This starts from a deploy and lands the answer on the change, including changes too small to be an anomaly.

Sample comment

Synthetic: the test suite's made-up Cost Explorer series for one deploy. No real account. The comment as posted (Markdown, shown as text here):

<!-- dawnfix-receipt:sha=abc1234def5678abc1234def5678abc1234def56 -->
### deploy abc1234: +$40.07/day (+305%), mostly NAT Gateway data processing (+$35.10/day)

Deployed 2026-10-20T14:03:00Z. 3 day(s) before (Oct 17–Oct 19) vs 3 of 3 day(s) after (Oct 21–Oct 23); the deploy day is left out. Daily UnblendedCost, credits and refunds excluded.

Total: **$13.13/day → $53.20/day** (+$40.07/day; baseline day-to-day spread ±$0.09)

| What changed | Before $/day | After $/day | Δ $/day |
|---|---:|---:|---:|
| NAT Gateway data processing | 2.00 | 37.10 | +$35.10 |
| EC2 t3.medium instance hours | 10.13 | 15.10 | +$4.97 |
| S3 storage | 1.00 | 1.00 | +$0.00 |

<sub>Correlation, not causation: traffic and other deploys in the window move cost too. Cost Explorer requests this run: 1 (≈$0.01), cache hits: 0. Dawnfix Receipt 0.5.0 · https://dawnfix.dev/receipt</sub>

Two days earlier, the same comment was still provisional:

<!-- dawnfix-receipt:sha=abc1234def5678abc1234def5678abc1234def56 -->
### deploy abc1234: +$40.07/day (+305%), mostly NAT Gateway data processing (+$35.10/day)

Deployed 2026-10-20T14:03:00Z. 3 day(s) before (Oct 17–Oct 19) vs 1 of 3 day(s) after (Oct 21–Oct 21); the deploy day is left out. Daily UnblendedCost, credits and refunds excluded.

Total: **$13.13/day → $53.20/day** (+$40.07/day; baseline day-to-day spread ±$0.09)

| What changed | Before $/day | After $/day | Δ $/day |
|---|---:|---:|---:|
| NAT Gateway data processing | 2.00 | 37.10 | +$35.10 |
| EC2 t3.medium instance hours | 10.13 | 15.10 | +$4.97 |
| S3 storage | 1.00 | 1.00 | +$0.00 |

_Provisional: Cost Explorer lags about 24h. Re-run after 2026-10-25T00:00:00Z for the final numbers; this comment updates in place._

<sub>Correlation, not causation: traffic and other deploys in the window move cost too. Cost Explorer requests this run: 1 (≈$0.01), cache hits: 0. Dawnfix Receipt 0.5.0 · https://dawnfix.dev/receipt</sub>

What leaves your CI

The comment, with the real figures, is posted from your runner to your GitHub and stays there. Without an Enterprise key nothing else leaves. With one, the hosted service gets only this, per deploy, for your status page trend and the daily digest:

FieldWhat it is
deploy_id16 hex of a SHA-256 over a fixed prefix and the commit SHA: "the same deploy again" across the daily re-runs. Not the SHA.
deployed_onthe UTC day of the deploy.
window_daysdays compared on each side (3 by default).
after_daysafter-days that have settled in Cost Explorer so far.
finalevery after-day has settled; until then the comparison is provisional.
materialthe change cleared the noise floor (the larger of $1/day, 3% of the baseline, twice its day-to-day spread).
delta_cents_per_day_bucketthe $/day change in cents, rounded toward zero to a 1-2-5 grid: 2000 means +$20 to +$50 a day.
top_driverthe AWS product family that moved most, from a fixed list (EC2, RDS, S3, NAT and other EC2 costs, …), or none.

Never sent: the commit SHA, the before and after totals (so the size of your bill), usage types (they carry regions and instance sizes), cost allocation tag keys or values, resource, account or repo names. The service rejects any other field. Exactly what leaves, for the sample above:

{
  "deploys": [
    {
      "after_days": 3,
      "delta_cents_per_day_bucket": 2000,
      "deploy_id": "cbac9ea4c3b4dddf",
      "deployed_on": "2026-10-20",
      "final": true,
      "material": true,
      "top_driver": "ec2_other",
      "window_days": 3
    }
  ],
  "generated_at": "2026-10-25T09:00:00Z",
  "schema": "dawnfix.receipt/1"
}

The IAM policies

The role the workflow assumes through GitHub OIDC can make one call. This is receipt/iam/receipt-ce-read-policy.json, verbatim; the CLI refuses anything else before the request is built:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DawnfixReceiptCostExplorerRead",
      "Effect": "Allow",
      "Action": [
        "ce:GetCostAndUsage"
      ],
      "Resource": "*"
    }
  ]
}

Its trust policy (receipt/iam/github-oidc-trust-policy.json) trusts one GitHub environment of one repo; replace ACCOUNT_ID and OWNER/REPO:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "GitHubOidcReceiptEnvironmentOnly",
      "Effect": "Allow",
      "Principal": {
        "Federated": "arn:aws:iam::ACCOUNT_ID:oidc-provider/token.actions.githubusercontent.com"
      },
      "Action": "sts:AssumeRoleWithWebIdentity",
      "Condition": {
        "StringEquals": {
          "token.actions.githubusercontent.com:aud": "sts.amazonaws.com",
          "token.actions.githubusercontent.com:sub": "repo:OWNER/REPO:environment:dawnfix-receipt"
        }
      }
    }
  ]
}

Set it up

  1. Create the role from the two policies above.
  2. Add .github/workflows/dawnfix-receipt.yml that calls the reusable workflow dawnfix/dawnfix/.github/workflows/receipt.yml@v0 with your role's ARN. The job runs in the GitHub environment dawnfix-receipt, which the trust policy names:
    name: dawnfix-receipt
    on:
      deployment_status:
      schedule: [{ cron: "17 9 * * *" }]
      workflow_dispatch: { inputs: { sha: { required: true }, deployed-at: { required: true } } }
    permissions: { contents: write, deployments: read, id-token: write }
    jobs:
      receipt:
        uses: dawnfix/dawnfix/.github/workflows/receipt.yml@v0
        with:
          role-arn: arn:aws:iam::123456789012:role/dawnfix-receipt
        secrets:
          DAWNFIX_ENTERPRISE_KEY: ${{ secrets.DAWNFIX_ENTERPRISE_KEY }}   # optional
    Pin @v0.5.0 or a commit SHA instead of @v0 to freeze it. Rather keep the whole job in your repo? Copy templates/github/workflows/dawnfix-receipt.yml and set the role ARN as the repo variable RECEIPT_ROLE_ARN.
  3. Optional: set your Enterprise key as the DAWNFIX_ENTERPRISE_KEY secret for the status page trend and the digest section. Without it nothing is sent. Contact us for Enterprise.

To try it by hand on one deploy, install the CLI from PyPI with pip install dawnfix (version 0.5.0; its code is in receipt/):

receipt --deploy-sha "$SHA" --deployed-at 2026-10-20T14:03:00Z --window 3d --post --repo owner/name

Or use it from your coding agent: paste prompts/receipt.md.

Cleaning up after a migration first? The free Dawnfix Sweeper lists what the old stack still costs.