[{"data":1,"prerenderedAt":72},["ShallowReactive",2],{"pattern-apigw-lambda-bedrock-s3":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":15,"extension":16,"framework":17,"gitHub":18,"highlight":6,"introBox":24,"language":31,"level":32,"meta":33,"patternArch":34,"resources":59,"s3URL":6,"services":6,"stem":67,"testing":68,"videoId":6,"__hash__":71},"patterns\u002Fpatterns\u002Fapigw-lambda-bedrock-s3.json","Generate image with Amazon Bedrock, AWS Lambda, and Amazon API Gateway",null,{"text":8},[9],"Delete the stack: \u003Ccode>cdk delete\u003C\u002Fcode>.",[11],"content\u002Fcontributors\u002Fchris-peter-francis.json",{"text":13},[14],"cdk deploy","Generate images using Amazon Bedrock from an AWS Lambda function fronted with API Gateway and save to Amazon S3","json","AWS CDK",{"template":19},{"repoURL":20,"templateURL":21,"projectFolder":22,"templateFile":23},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fapigw-lambda-bedrock-s3-cdk-python","serverless-patterns\u002Fapigw-lambda-bedrock-s3-cdk-python","apigw-lambda-bedrock-s3-cdk-python","apigw_lambda_bedrock\u002Fapigw_lambda_bedrock_s3_stack.py",{"headline":25,"text":26},"How it works",[27,28,29,30],"This project builds an integration between Amazon API Gateway, AWS Lambda, Amazon Bedrock and Amazon S3","The core functionality revolves around exposing an API endpoint via API Gateway that accepts a user-defined prompt.","When a prompt is received, API Gateway invokes an AWS Lambda function. This function is responsible for invoking a diffusion image generation model (Stable Diffusion XL 1.0) hosted on Amazon Bedrock, generating an image and saving it to Amazon S3.","To ensure compatibility with Bedrock, a Lambda Layer is used, it contains the latest version of the Boto3 library, as only the most recent Boto3 version includes a client for Amazon Bedrock.","Python","200",{},{"icon1":35,"icon2":40,"icon3":44,"icon4":48,"line1":52,"line2":55,"line3":57},{"x":36,"y":37,"service":38,"label":39},15,50,"apigw","API Gateway REST API",{"x":41,"y":37,"service":42,"label":43},40,"lambda","AWS Lambda",{"x":45,"y":37,"service":46,"label":47},65,"bedrock","Amazon Bedrock",{"x":49,"y":37,"service":50,"label":51},90,"s3","Amazon S3",{"from":53,"to":54},"icon1","icon2",{"from":54,"to":56},"icon3",{"from":56,"to":58},"icon4",{"bullets":60},[61,64],{"text":62,"link":63},"Amazon Bedrock API Reference","https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock\u002Flatest\u002FAPIReference\u002Fwelcome.html",{"text":65,"link":66},"Packaging custom boto3 version as a layer","https:\u002F\u002Frepost.aws\u002Fknowledge-center\u002Flambda-python-runtime-errors","patterns\u002Fapigw-lambda-bedrock-s3",{"text":69},[70],"See the GitHub repo for detailed testing instructions.","sI3Dv7rzKO0aSmkg8KKQT0hlA9STGvpT5NQ69EaiMZw",1778846882076]