You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit af2f4b5
Browse filesBrowse the repository at this point in the historyBrowse files
Brings in "feat(core): serve an API namespace from a container compute"
(#1105) and "ci(cleanup): fail the sweep leg when REST APIs can't be counted"
(#959).
packages/core/src/api.ts: ApiNamespaceOptions keeps this branch's
httpErrorStatus option and its docs, and takes #1105's container compute docs
and widened `compute` type ('serverless' | 'container'). A container compute
serves the whole backend module through the shared dispatch core, which
already answers a 4xx ApiError of an httpErrorStatus namespace with its
status; http-server.test.ts now checks that against the Lambda handler.
.github/workflows/cleanup-stacks.yml (REST API sweep): takes #959's
list-stacks fail-safe (retries, the CLI's reason as a warning), its
rest-api-quota.sh headroom check and its exit on a listing or count failure,
and keeps this branch's separate ownership and budget deferral counts in the
summary and warnings.
# Conflicts:
# .github/workflows/cleanup-stacks.yml
# packages/core/src/api.ts
The container's tasks serve the namespace with the same dispatch as the Lambda handler (CORS, cookies, error envelopes), so clients call it exactly as before at `/aws-blocks/api/render`.
16
+
17
+
- The shared API gateway reaches the tasks through a VPC link to an internal Application Load Balancer that the compute provisions in the app's VPC: one load balancer and one listener per backend, with a path rule per namespace forwarding to its container's target group, health-checked on the task's readiness port. A container that only runs jobs gets no target group.
18
+
- The tasks admit the load balancer on a security group of their own; the shared compute security group stays closed to inbound traffic.
19
+
- The load balancer drops request headers that aren't valid HTTP before they reach a task.
20
+
- API calls to a container keep the gateway's ~29-second cap. A stopping task finishes its in-flight requests (up to 35 s) before it shuts down.
21
+
- A `Scope` with a container `compute` now places its `ApiNamespace`s on that container too, instead of failing synth.
22
+
- A container that serves API namespaces needs a running task: `scaling.minInstances: 0` fails synth. Without a `scaling.strategy`, one that also runs an `AsyncJob` scales on CPU, and its queue backlog adds tasks too.
23
+
- Moving a namespace that already serves traffic onto a container: during that deploy, its calls can get 503s for the minute or two the new tasks take to start.
24
+
-`runContainer()` takes the backend module (`runContainer({ backend })`) and serves its API on port 8080, with readiness on port 8081; called without it, the container answers a health check on port 8080 as before. A container compute passes it only when the compute serves API traffic.
25
+
- The container compute's dashboard section gains API request, 5xx, latency and task-health widgets.
0 commit comments