Skip to main content

Deployment Architecture

Diagram

Resources

The backend stack provisions 21 resources. Conditional resources are created only when their associated feature flag is enabled.

Logical IDTypeDescription
PassengersTableAWS::DynamoDB::TableDynamoDB table for passenger data with PAY_PER_REQUEST billing and SSE enabled. Conditional: created only when EnablePassengersTable=true.
LambdaExecutionRoleAWS::IAM::RolePer-function execution role with least-privilege policies. Includes conditional policies for DynamoDB, SQS, and always-on policies for ECR pull, Bedrock invocation, and CloudWatch metrics.
LambdaFunctionAWS::Lambda::FunctionContainer-packaged Lambda function. Receives environment variables for auth configuration, invoke mode, namespace, environment, and optionally SQS queue URL. Reserved concurrency set to 50.
LambdaLogGroupAWS::Logs::LogGroupCloudWatch log group for Lambda function output. Retention set to 30 days.
HttpApiAWS::ApiGatewayV2::ApiHTTP API (API Gateway v2) with CORS configuration allowing GET, POST, PUT, DELETE, and OPTIONS methods.
JwtAuthorizerAWS::ApiGatewayV2::AuthorizerJWT authorizer configured with the Cognito issuer URL and client ID. Extracts tokens from the Authorization header.
BufferedIntegrationAWS::ApiGatewayV2::IntegrationAWS_PROXY integration for standard (buffered) routes. 30-second timeout. Payload format version 2.0.
StreamingIntegrationAWS::ApiGatewayV2::IntegrationAWS_PROXY integration for SSE streaming routes. 30-second timeout. Payload format version 2.0.
GetRouteAWS::ApiGatewayV2::RouteGET /{proxy+} route using the buffered integration with JWT authorization.
PostRouteAWS::ApiGatewayV2::RoutePOST /{proxy+} route using the buffered integration with JWT authorization.
PutRouteAWS::ApiGatewayV2::RoutePUT /{proxy+} route using the buffered integration with JWT authorization.
DeleteRouteAWS::ApiGatewayV2::RouteDELETE /{proxy+} route using the buffered integration with JWT authorization.
SseRouteAWS::ApiGatewayV2::RouteGET /api/v1/sse/{proxy+} route using the streaming integration with JWT authorization.
DefaultStageAWS::ApiGatewayV2::Stageprod stage with auto-deploy enabled and structured JSON access logging.
LambdaInvokePermissionAWS::Lambda::PermissionGrants API Gateway permission to invoke the Lambda function. Scoped to the specific HTTP API.
ApiGatewayLogGroupAWS::Logs::LogGroupCloudWatch log group for API Gateway access logs. Retention set to 30 days.
ApplicationErrorsFilterAWS::Logs::MetricFilterMetric filter on the Lambda log group that matches ERROR log lines and emits an ApplicationErrorCount metric.
UnhandledExceptionsFilterAWS::Logs::MetricFilterMetric filter on the Lambda log group that matches structured JSON exceptions and Python tracebacks, emitting an UnhandledExceptionCount metric.
HighErrorRateAlarmAWS::CloudWatch::AlarmFires when ApplicationErrorCount reaches 5 or more within a 5-minute period. Alarm actions require AlarmSnsTopicArn to be set.
HighExceptionRateAlarmAWS::CloudWatch::AlarmFires when UnhandledExceptionCount reaches 5 or more within a 5-minute period. Alarm actions require AlarmSnsTopicArn to be set.
AppDashboardAWS::CloudWatch::DashboardCloudWatch dashboard with four widget sections: Application Errors (custom metrics), Lambda Health (invocations, duration percentiles, errors, throttles), API Gateway (requests, latency, 4xx/5xx errors), and Bedrock Usage (token counts, latency, throttles).