Reference only. This page is a public snapshot of an internal
document from the private repository
thejustinjames/baha-alert
(visible to collaborators only). The authoritative sources are the CDK in
IaC/aws and the settings rationale in IaC/DEPLOYED.md,
both in that repo. Everything here was read back from the live account
rather than from the code. The agency data-access request letters are
public in
data-access/.
The pipeline
Rain becomes a reading, a reading becomes an event, an event becomes a warning.
Why delivery is split in two. baha-notify needs
Postgres, which is in the VPC. Expo needs the internet, which this VPC
deliberately cannot reach. Rather than buy a route between them for about
$32/month, the notifier resolves recipients and writes the ledger, then
synchronously invokes a sender that has no database access and does nothing
but send. The call is synchronous on purpose: fire-and-forget would be
cheaper and would ruin the audit trail, because "handed to another function"
is not an outcome anybody can act on after a flood.
Stacks
Six, all CDK. cdk diff --all reports no differences against deployed state.
| Stack | Region | Contains |
|---|---|---|
| BahaArchive-dev | ap-southeast-1 | Raw archive bucket, tiles bucket |
| BahaDns-dev | ap-southeast-1 | Route 53 zone phflood.agrisphere.asia |
| BahaIngest-dev | ap-southeast-1 | Collectors, schedules, both queues, DLQs, alarms, ops topic |
| BahaData-dev | ap-southeast-1 | VPC, RDS, normalizer, notify, push sender, VPC endpoints |
| BahaApi-dev | ap-southeast-1 | HTTP API and Fastify Lambda |
| BahaBilling-dev | us-east-1 | Budget and cost alarms — billing metrics exist only there |
Compute
| Function | Runtime | Mem | Timeout | In VPC |
|---|---|---|---|---|
| baha-collector-pmt_water | nodejs22 arm64 | 512 | 90 s | no |
| baha-collector-warning_posts | nodejs22 arm64 | 512 | 90 s | no |
| baha-collector-rainfall | nodejs22 arm64 | 512 | 90 s | no |
| baha-collector-dams | nodejs22 arm64 | 512 | 90 s | no |
| baha-normalizer | nodejs22 arm64 | 512 | 60 s | yes |
| baha-api | nodejs22 arm64 | 512 | 30 s | yes |
| baha-notify | nodejs22 arm64 | 512 | 90 s | yes |
| baha-push-sender | nodejs22 arm64 | 256 | 20 s | no |
Guardrails
| Alarm | Fires when |
|---|---|
| baha-collector-*-failing | A collector fails repeatedly — four of them, one per source |
| baha-raw-observations-dlq | A reading could not be parsed |
| baha-notifications-dlq | A warning was not delivered |
All route to SNS baha-ops-alerts-dev. Budget
baha-alert-monthly is $150, with a separate account-wide cost
topic in us-east-1.
Added 2026-08-09. The notifications DLQ had no alarm. It was the only queue without one, and it is the one carrying flood warnings — a derived event could fail delivery three times and sit there with nobody told. The observations queue, carrying readings, was alarmed from the start.
Not managed by CloudFormation
cdk diff will never mention these.
| Resource | Created by | Note |
|---|---|---|
| Amplify baha-preview | IaC/scripts/deploy-amplify-preview.sh | Password-protected preview environment. Manual zip deploy rather than a Git connection, to avoid holding a GitHub token |
| Android signing assets | IaC/scripts/build-android.sh | Release signing material is created by script rather than CDK |
Outside AWS
| Thing | Where |
|---|---|
| www.agrisphere.asia | Cloudflare Pages project manila-flood-monitor |
| agrisphere.asia DNS | GoDaddy — not Cloudflare, not Route 53 |
| phflood.agrisphere.asia | Route 53, delegated from GoDaddy by NS records |
| iOS builds, push keys | EAS (Expo) |
One DNS hazard. The NS records delegating
phflood to Route 53 live at GoDaddy, not in Route 53 itself.
Lose them and the API domain goes with them — both
api.phflood.agrisphere.asia and the Amplify preview.
The www CNAME was corrected on 2026-08-09 and now names
manila-flood-monitor.pages.dev everywhere. The old
manilia-flood-monitor project is no longer load-bearing and
can be deleted. The apex has no records and does not resolve; GoDaddy
cannot CNAME an apex, so reaching the site without www needs
GoDaddy Forwarding.
Known gaps
- Upper Wawa has no live feed — the adapter exists, a public endpoint does not.
PUSH_ENABLED=false: delivery is deployed and deliberately inert until a full storm has been watched end to end.- Watershed geometry is a hand-drawn envelope, so the impact resolver still refuses to deliver on it.
- Single AZ, 1-day backups — acceptable while S3 holds the immutable archive and the database is derived state.