[{"data":1,"prerenderedAt":66},["ShallowReactive",2],{"pattern-apigw-lambda-bedrock-js-sam":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":11,"deploy":13,"description":17,"extension":18,"framework":19,"gitHub":20,"highlight":6,"introBox":26,"language":33,"level":34,"meta":35,"patternArch":36,"resources":55,"s3URL":6,"services":6,"stem":61,"testing":62,"videoId":6,"__hash__":65},"patterns\u002Fpatterns\u002Fapigw-lambda-bedrock-js-sam.json","Amazon API Gateway to AWS Lambda to Amazon Bedrock",null,{"text":8},[9,10],"1. Delete the stack: \u003Ccode>sam delete\u003C\u002Fcode>.","2. Delete Lambda layer stack: \u003Ccode>.\u002Fdelete_lambda_layer.sh\u003C\u002Fcode>.",[12],"content\u002Fcontributors\u002Fsaborni-bhattacharya.json",{"text":14},[15,16],"sam deploy --guided",".\u002Fcreate_lambda_layer.sh","Make a request to Bedrock via API Gateway.","json","AWS SAM",{"template":21},{"repoURL":22,"templateURL":23,"projectFolder":24,"templateFile":25},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fapigw-lambda-bedrock-js-sam","serverless-patterns\u002Fapigw-lambda-bedrock-js-sam","apigw-lambda-bedrock-js-sam","template.yaml",{"headline":27,"text":28},"How it works",[29,30,31,32],"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.","Node.js","200",{},{"icon1":37,"icon2":42,"icon3":45,"line1":49,"line2":53},{"x":38,"y":39,"service":40,"label":41},20,50,"apigw","API Gateway",{"x":39,"y":39,"service":43,"label":44},"lambda","AWS Lambda",{"x":46,"y":39,"service":47,"label":48},80,"bedrock","Amazon Bedrock",{"from":50,"to":51,"label":52},"icon1","icon2","",{"from":51,"to":54,"label":52},"icon3",{"headline":56,"bullets":57},"Additional resources",[58],{"text":59,"link":60},"Amazon Bedrock Model Access","https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock\u002Flatest\u002Fuserguide\u002Fmodel-access.html","patterns\u002Fapigw-lambda-bedrock-js-sam",{"text":63},[64],"See the GitHub repo for detailed testing instructions.","RYikE3QqueUEn5dmCr60N3Qye2aHEiUgVZbfAwHZ5p8",1781692542028]