Skip to content

StageResource

Source: src/AWS/ApiGatewayV2/Stage.ts

An API Gateway v2 Stage — the deployed, callable endpoint of an HTTP or WebSocket API.

The canonical modern setup is a single $default stage with autoDeploy: true — every route/integration change goes live automatically at the API root endpoint, with no Deployment juggling.

const stage = yield* ApiGatewayV2.Stage("Stage", {
api,
autoDeploy: true,
});
// stage.invokeUrl === api.apiEndpoint
const dev = yield* ApiGatewayV2.Stage("Dev", {
api,
stageName: "dev",
autoDeploy: true,
stageVariables: { logLevel: "debug" },
});
const stage = yield* ApiGatewayV2.Stage("Stage", {
api,
autoDeploy: true,
defaultRouteSettings: {
ThrottlingBurstLimit: 100,
ThrottlingRateLimit: 50,
},
});