What did that deploy do to the AWS bill?
Works with AWS Cost Explorer GitHub Actions GitHub
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.
How it works
- On every successful production deploy (
deployment_status),dawnfix-receipt.ymlposts 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:
| Field | What it is |
|---|---|
deploy_id | 16 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_on | the UTC day of the deploy. |
window_days | days compared on each side (3 by default). |
after_days | after-days that have settled in Cost Explorer so far. |
final | every after-day has settled; until then the comparison is provisional. |
material | the change cleared the noise floor (the larger of $1/day, 3% of the baseline, twice its day-to-day spread). |
delta_cents_per_day_bucket | the $/day change in cents, rounded toward zero to a 1-2-5 grid: 2000 means +$20 to +$50 a day. |
top_driver | the 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
- Create the role from the two policies above.
- Add
.github/workflows/dawnfix-receipt.ymlthat calls the reusable workflowdawnfix/dawnfix/.github/workflows/receipt.yml@v0with your role's ARN. The job runs in the GitHub environmentdawnfix-receipt, which the trust policy names:
Pinname: 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@v0.5.0or a commit SHA instead of@v0to freeze it. Rather keep the whole job in your repo? Copytemplates/github/workflows/dawnfix-receipt.ymland set the role ARN as the repo variableRECEIPT_ROLE_ARN. - Optional: set your Enterprise key as the
DAWNFIX_ENTERPRISE_KEYsecret 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.
Set up Dawnfix (https://github.com/dawnfix/dawnfix), the source-available AI SRE, in this GitHub repo and try it once. Follow prompts/setup.md in that repo, step by step. In short: npx dawnfix init writes .dawnfix.yml and a 15-line workflow that calls dawnfix/dawnfix/.github/workflows/dawnfix.yml@v0. Then comes a read-only cloud role, then two repo settings set by name. For the local CLI, run pip install dawnfix==0.5.0. Rules: - Before you change anything (a file, a cloud role, a repo variable, a commit, a PR), tell me exactly what you will change and wait for my yes. - Least privilege: the AWS role or GCP identity must be read-only. Check the AWS role with infra/aws/verify_readonly.py from the Dawnfix repo, and stop if it fails. Never widen a policy to make it pass. - Never ask me to paste a secret into this chat, and never print one. I set my AI API key (Claude today) myself with gh secret set DAWNFIX_AI_API_KEY, and DAWNFIX_ENTERPRISE_KEY only if I have Enterprise. - Start with autonomy: diagnose in .dawnfix.yml (issues only, no code changes). Never push to the default branch; everything goes through a PR I review. - Tell me what it costs me: my own Claude tokens (on my AI API key), GitHub Actions minutes and small CloudWatch API charges. No Dawnfix key is needed. To try it, run this with my read-only credentials and show me the JSON it prints: dawnfix tick --config .dawnfix.yml --state "$(mktemp -d)/state.json" --baseline --dry-run Then open the setup PR.