explanation2 min readv1
Foundation
The Foundation is the one project every product shares. It provides routing, identity, events and observability once per stage, so a Slice does not have to build or pay for its own.
What it provides
| Capability | Resource |
|---|---|
| Routing | One Router per stage. Each Slice is served at its own path, and the root site at /. |
| Identity | A Cognito user pool and its hosted domain, shared by every Slice’s sign-in. |
| Events | An EventBridge event bus for the stage. |
| Observability | CloudWatch logs and basic alarms. |
| Discovery | A contract in SSM Parameter Store that Slices read to find the shared resources. |
| SQL, when declared | A VPC and Aurora PostgreSQL, provisioned only after a Slice adds SQL. |
How Slices use it
A Slice does not create a user pool or a router. Its infrastructure reads the Foundation contract for the stage and attaches to what is there. That is why a Slice’s dev and deploy targets run foundation-preflight first: the target validates the deployed Foundation contract before the Slice is operated.
What runs when nothing is declared
The Foundation provisions the expensive parts only on request. A workspace whose Slices all use DynamoDB has no VPC and no database cluster. Aurora appears when a Slice adds SQL, and not before.
Continue building