Amazon API Gateway to AWS Lambda to Amazon Bedrock
API Gateway REST API → AWS Lambda → Amazon Bedrock
Make a request to Bedrock via API Gateway using Java and CDK
Amazon API Gateway receives the HTTP POST request containing the prompt.
AWS Lambda is triggered by API Gateway, this function sends the prompt to Amazon Bedrock with the Converse API in the AWS SDK for Java. It calls Anthropic Claude Haiku 5.5 through the global cross-Region inference profile, with a fixed output token limit for simplicity.
Based on the given prompt, Anthropic Claude Haiku 5.5 in Amazon Bedrock generates the content and returns the response to Lambda.
Lambda processes the Bedrock output and sends it back to the user via the API Gateway.