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 forwards the prompt to Amazon Bedrock API using AWS SDK for Java. It uses Anthropic Claude-v2 model and sets other required parameters to fixed values for simplicity.
Based on the given prompt, using Anthropic Claude-v2 model, 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.