This is a password-protected wedding website made of three prerendered Angular apps served from one private S3 bucket through CloudFront. A Lambda@Edge function checks every request for a valid guest token before anything is served. A small API on API Gateway and Lambda handles login, after-party access and RSVPs, and AWS CDK defines all of it. This blog post covers how it was built.
Check out the demo site for an “anonymized” version of the original site and the GitHub repo for more detailed information and extended documentation about the site.
Tech Stack
| Layer | Technology |
|---|---|
| Front ends | Angular 21 (static output, every route prerendered), TypeScript 5.9, RxJS |
| UI libraries | ngx-toastr, google-libphonenumber (E.164 phone validation) |
| Hosting | Amazon S3 (private, OAC), CloudFront, ACM, Route 53 |
| Edge auth | Lambda@Edge (viewer request), Node 24 |
| API | API Gateway REST API on a custom api. domain, Lambda (Node 24, bundled with esbuild) |
| Data | DynamoDB (on-demand): auth tokens with TTL, RSVPs |
| Secrets | AWS Secrets Manager |
| Protection | AWS WAF (geo-block plus AWS managed rule sets), API Gateway throttling |
| Infrastructure | AWS CDK v2 in TypeScript, four stacks |
| Tests | Jest 30 with ts-jest and a mocked AWS SDK (Lambdas); Karma and Jasmine (apps) |
Architecture
Components
- Three Angular apps in one bucket: login at
/(login/prefix), the main site at/w/*(party details, RSVP, story, travel, registry), and the hidden after-party site at/s/*. Both of the last two live under thewed/prefix. - Route 53 stack: imports the existing hosted zone and issues a DNS-validated ACM certificate for the apex and a wildcard.
- Secret stack: imports a hand-made Secrets Manager secret holding the main and after-party passwords. Their values never appear in a template.
- Api stack:
POST /authandPOST /secret(validate handler) andPUT /rsvp(RSVP handler), on stageprod, mapped toapi.<domain>/v1. Login endpoints are throttled to 5 requests/second, with a burst of 10. CORS allows only the apex. - CloudFront stack: private bucket with OAC, three cache behaviours, the Lambda@Edge validator on all of them, a WAF web ACL that only allows the US and Canada (plus the IP reputation, common and known-bad-inputs rule sets), and A/AAAA aliases.
- DynamoDB:
wedding-auth-table(keyuuid, 60-day TTL, fixed name because Lambda@Edge has no environment variables) and an RSVP table (keyfirstName+lastName).
Login sequence
api. and the site itself.Request sequence
/ pass straight through. /w and /s without a trailing slash get a 301 before any check. The 401 is a JSON body, not a redirect to the login page.After-party unlock
POST /secretwith the second password runs a conditionalUpdateItem SET party=trueon the guest’s existing token. After that, the edge function lets/s/*through.
Deployment
Infrastructure (manual)
- One-time: bootstrap CDK in
us-east-1and create the secret by hand. - Deploy:
npm run deploy(tsc --noEmit && cdk deploy --all), which deploys Route53 → Secret → Api → CloudFront in order.
Site content (manual)
ng buildeach app.aws s3 synceach build to its prefix.- CloudFront invalidation of
/*. - Run the 7-step checklist in
docs/deployment.md.
Estimated Cost
| Item | Estimate |
|---|---|
| AWS WAF web ACL + rules | ~$15 / month + $0.60 per million requests |
| Secrets Manager (1 secret) | ~$0.40 / month |
| Route 53 hosted zone | ~$0.50 / month |
| API Gateway | free for 12 months, then ~$3.50 per million calls |
| DynamoDB (on-demand) | pennies at wedding traffic |
| Lambda@Edge | free-ish tier |
| S3, CloudFront, ACM | free-ish tier |
| Domain registration | ~$20 |
| Total | ~$160 |
Highlights
- No guest can load any page or asset, not even from the cache, without a valid token checked at the edge.
- Passwords live only in Secrets Manager. The CDK templates don’t contain them, the real domain stays out of the docs, and the stacks never hard-code the account ID.
- Guests log in once and stay logged in for 60 days through an HttpOnly cookie shared between
api.and the apex. - A second, hidden tier unlocks on the same token.
- The WAF and API throttling protect a public login form on a tiny budget.
- Each Lambda has a Jest unit test with the AWS SDK mocked.
Known Limitations
- No logout and no way to revoke one token. Old passwords keep working until Lambda containers recycle.
- RSVPs are keyed by name and a plus-one is saved in two separate writes.
- An expired token shows raw JSON instead of the login page.
- Every request makes a cross-region DynamoDB lookup from the edge, even for cached assets.
- The API isn’t behind the WAF, and the throttle is shared by everyone.