New serverless pattern - lambda-bedrock-mantle-responses-api-cdk#3133
Conversation
…Bedrock Mantle Responses API pattern
|
Hello @NithinChandranR-AWS. The Serverless Patterns Collection focuses on IaC-focused implementations of 2-4 AWS services in commonly used architectural combinations, where the serverless component is integral to the design. If you believe this assessment is incorrect, please let us know what architectural distinction we may have missed. |
|
That's a fair assessment — the architecture is the same underlying APIGW → Lambda → Bedrock wiring, just using the OpenAI-compatible endpoint. Closing this. Thank you for your time and help. |
New Serverless Pattern: Amazon Bedrock Mantle Responses API with AWS Lambda (OpenAI SDK Compatible)
Description
Deploys an API Gateway + Lambda function that calls Amazon Bedrock via the OpenAI-compatible Responses API (bedrock-mantle endpoint) using the standard OpenAI Python SDK. Shows customers how to migrate existing OpenAI applications to Bedrock with minimal code changes — just swap the base URL and API key.
Architecture
Key Features
Framework / Language
Changes
lib/stack.ts— CDK stack: Lambda with bundled openai package, API Gateway REST API, CfnParameter for API keysrc/index.py— Lambda handler using client.responses.create()src/requirements.txt— openaiREADME.md— Architecture, prerequisites (Bedrock API key generation), deployment, testing with curlexample-pattern.json— Pattern metadataTesting
{"response": "Amazon Bedrock is a fully managed AWS service...", "model": "openai.gpt-oss-120b", "id": "resp_..."}