Repository navigation
feat: apiGateway component - AWS API Gateway on LocalStack with imported OpenAPI specs - #71
Conversation
✅ Deploy Preview for orbital-nebula canceled.
|
…ted OpenAPI specs
Adds an `apiGateway { }` block that starts LocalStack with API Gateway
enabled, imports each declared OpenAPI document as a REST API and deploys
it to a stage. Orbital treats API Gateway as a schema registry, so this
gives a stack something for it to browse and pull.
apiGateway {
restApi("pets", stage = "v1", openApi = petsOpenApi)
restApiFromFile("orders", path = "/abs/orders.yaml")
}
The emitted config is flat (accessKey, secretKey, region, endpointOverride,
<name>ApiId, <name>Stage, <name>InvokeUrl) so every value reaches Orbital
as an env variable, eg NEBULA_API_GATEWAY_PETS_API_ID.
REST APIs only: the community LocalStack image has no API Gateway v2.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011c7t8dqC37eQzTt9o44x9v
459f567 to
c06606a
Compare
|
Rebased onto 🤖 — Claude |
…reach the Nebula host
A spec deployed to the gateway can carry x-amazon-apigateway-integration
blocks that proxy to an http { } stub running where Nebula runs. The
LocalStack container needs a route back to that host; on Linux Docker
doesn't provide host.docker.internal by default, so add it explicitly
with the host-gateway alias.
Verified with the api-gateway-registry demo: 14 APIs imported from a
bundle, a call through a stage's invoke URL is proxied to the stub with
path and query parameters intact.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011c7t8dqC37eQzTt9o44x9v
|
Added stable API ids (070017c). Also documented that response schemas must be named models under 🤖 — Claude |
Adds an
apiGateway { }component: LocalStack with API Gateway enabled, with OpenAPI documents imported as REST APIs and deployed to a stage. Orbital treats API Gateway as a schema registry (see vyne!2176), so this gives a stack something for it to browse and pull.stack { apiGateway { restApi("pets", stage = "v1", openApi = petsOpenApi) restApiFromFile("orders", path = "/abs/orders.yaml") // stage defaults to "prod" } }What's emitted
The component config is flat so Orbital exposes every value as an env variable:
accessKey,secretKey,region,endpointOverrideNEBULA_API_GATEWAY_ENDPOINT_OVERRIDEetc<name>ApiId,<name>Stage,<name>InvokeUrlNEBULA_API_GATEWAY_PETS_API_IDetcDashed API names are camel-cased (
pet-store->petStoreApiId). The docs page shows aconnections.conf+registries.confpair wired to these.Notes
x-amazon-apigateway-integrationblocks, as on AWS. Without them it exists for schema export, which is what Orbital's registry sync needs.restApiFromFilecurrently resolves on the Nebula server's filesystem, likes3 { file(path) }. Once feat(bundles): submit a stack together with the files it reads #70 (stack bundles) lands, it should resolve throughresources.resolveFilePath(path)so files can ship with the stack.GetCallerIdentity.Tests
ApiGatewayExecutorTestruns against LocalStack: imports a spec, checks the OpenAPI export contains the path and schema, and checks the emitted config carries the API id, stage and invoke URL.🤖 Generated with Claude Code
https://claude.ai/code/session_011c7t8dqC37eQzTt9o44x9v