Amazon API Gateway to AWS Lambda to Amazon Bedrock
API Gateway → AWS Lambda → Amazon Bedrock
Make a request to Bedrock via API Gateway.
Amazon API Gateway receives the HTTP POST request containing the prompt.
AWS Lambda is triggered by the API Gateway endpoint. This function forwards the prompt to Amazon Bedrock API using the AWS SDK for JavaScript bedrock-runtime API. It uses the Anthropic Claude-v2 model and sets other required parameters to fixed values for simplicity.
Based on the given prompt, using the 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 API Gateway.