A daily 5 AM Pacific email digest of your Google Calendar for the next 7 days, with WSDOT highway alerts flagged against events whose locations would put them on an affected route. Runs as a single AWS Lambda on a schedule.
See calendar-digest-spec.md for the full design.
- Create a GCP project.
- Enable the Google Calendar API.
- Create a service account, generate a JSON key, and download it.
- In Google Workspace Admin → Security → Access and data control → API
controls → Domain-wide delegation, authorize the service account's
client ID with scope:
https://www.googleapis.com/auth/calendar.events.readonly
Request an access code at https://wsdot.wa.gov/traffic/api/.
Generate at https://console.anthropic.com.
In us-west-2, create one secret named calendar-digest/keys containing a
JSON object:
{
"google_service_account": "<<entire service-account JSON key, as a single JSON string>>",
"wsdot_access_code": "<<your WSDOT access code>>",
"anthropic_api_key": "sk-ant-..."
}The google_service_account value is the full service-account JSON file
encoded as a string (the inner braces and quotes are preserved inside the
outer JSON). The Lambda reads the outer object and then json.loads() that
field a second time.
Verify the sender email in us-west-2:
aws ses verify-email-identity --email-address you@example.com --region us-west-2Confirm the link in your inbox. Stays in sandbox — sender == recipient.
cd infra
sam build --use-container
sam deploy --guided # first time only; writes samconfig.tomlWhen prompted, provide:
SecretsArn— ARN ofcalendar-digest/keysUserEmail— the recipient/sender/calendar-impersonation addressSesIdentityArn— e.g.arn:aws:ses:us-west-2:ACCOUNT:identity/you@example.com
Subsequent deploys: sam build --use-container && sam deploy.
Confirm the email subscription that arrives in your inbox after the first deploy.
aws lambda invoke --function-name <DigestFunctionName from stack outputs> \
--region us-west-2 /tmp/out.json
cat /tmp/out.jsonpython -m venv .venv && source .venv/bin/activate
pip install -r requirements-dev.txt
pytestFor a real end-to-end run locally (uses your AWS creds and the real secret),
populate .env with SECRETS_ARN and USER_EMAIL and run:
python scripts/local_run.py