Design

Design

Goals

Webform Relay is designed to be:

  • Minimal — one endpoint, one job: receive a form POST, forward it.
  • Stateless — no database, no sessions. Each invocation is independent.
  • Cheap to run — Lambda billing per-invocation means zero idle cost.
  • Easy to operate — deploy with one command, tear down with one command.

Architecture

Browser → API Gateway (POST /api/v1/submit)
              ↓
         Lambda (Go container)
              ↓
         Configured destinations
         (email / webhook / storage)

The Lambda function receives an APIGatewayProxyRequest, validates the payload, and dispatches to one or more configured relay targets.

Decisions

Go container over managed runtime

Container images are used instead of a zip-packaged managed runtime. This gives reproducible builds, a consistent environment between local and prod, and no dependency on the Lambda Go runtime version.

SAM for infrastructure

AWS SAM is the IaC layer. It is a thin wrapper over CloudFormation that understands Lambda-specific resources and generates the correct IAM policies. No Terraform, CDK, or Pulumi — SAM is sufficient for the scope of this project.

Single endpoint

The API surface is intentionally small: one POST /api/v1/submit endpoint. Additional endpoints can be added as separate SAM functions if needed rather than growing a monolithic handler.