[{"data":1,"prerenderedAt":88},["ShallowReactive",2],{"pattern-s3-bedrock-batch-inference-cdk":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":11,"deploy":14,"description":21,"extension":22,"framework":23,"gitHub":24,"highlight":6,"introBox":30,"language":38,"level":39,"meta":40,"patternArch":41,"resources":67,"s3URL":6,"services":6,"stem":81,"testing":82,"videoId":6,"__hash__":87},"patterns\u002Fpatterns\u002Fs3-bedrock-batch-inference-cdk.json","Amazon S3 to Amazon Bedrock Batch Inference with Amazon EventBridge Trigger",null,{"text":8},[9,10],"Empty the S3 bucket: \u003Ccode>aws s3 rm s3:\u002F\u002F{S3 bucket name} --recursive\u003C\u002Fcode>","Delete the stack: \u003Ccode>cdk destroy\u003C\u002Fcode>",[12,13],"content\u002Fcontributors\u002Fbiswanath-mukherjee.json","content\u002Fcontributors\u002Frakshith-rao.json",{"text":15},[16,17,18,19,20],"python3 -m venv .","source .\u002Fbin\u002Factivate","pip3 install -r requirements.txt","export AWS_REGION=us-west-2","cdk deploy --parameters ModelARN=\u003CARN of the model>","Demonstrates automated Bedrock batch inference triggered by S3 file uploads, orchestrated via EventBridge rules. Implemented using AWS CDK.","json","AWS CDK",{"template":25},{"repoURL":26,"templateURL":27,"projectFolder":28,"templateFile":29},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fs3-bedrock-batch-inference-cdk","serverless-patterns\u002Fs3-bedrock-batch-inference-cdk","s3-bedrock-batch-inference-cdk","app.py",{"headline":31,"text":32},"How it works",[33,34,35,36,37],"This pattern creates an S3 bucket to store the input and output of the batch inference job.","It also creates an EventBridge rule that is triggered when a batch inference input file is uploaded.","When the EventBridge rule is triggered, it uses an AWS-managed Lambda function (created automatically by the AwsApi target) to call the Bedrock createModelInvocationJob API.","This Lambda function creates a new Bedrock batch inference job with the specified model and the uploaded input file.","The output of the batch inference job is stored in the same S3 bucket.","Python","200",{},{"icon1":42,"icon2":47,"icon3":51,"icon4":55,"line1":59,"line2":63,"line3":65},{"x":43,"y":44,"service":45,"label":46},10,50,"s3","Amazon S3",{"x":48,"y":44,"service":49,"label":50},35,"eventbridge","Amazon EventBridge",{"x":52,"y":44,"service":53,"label":54},60,"lambda","AWS Lambda",{"x":56,"y":44,"service":57,"label":58},85,"bedrock","Amazon Bedrock",{"from":60,"to":61,"label":62},"icon1","icon2","",{"from":61,"to":64,"label":62},"icon3",{"from":64,"to":66,"label":62},"icon4",{"bullets":68},[69,72,75,78],{"text":70,"link":71},"Amazon Bedrock Batch Inference Documentation","https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock\u002Flatest\u002Fuserguide\u002Fbatch-inference.html",{"text":73,"link":74},"Supported Models and Regions for Batch Inference","https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock\u002Flatest\u002Fuserguide\u002Fbatch-inference-supported.html",{"text":76,"link":77},"EventBridge Targets Documentation","https:\u002F\u002Fdocs.aws.amazon.com\u002Feventbridge\u002Flatest\u002Fuserguide\u002Feb-targets.html",{"text":79,"link":80},"AWS CDK EventBridge Targets","https:\u002F\u002Fdocs.aws.amazon.com\u002Fcdk\u002Fapi\u002Fv2\u002Fpython\u002Faws_cdk.aws_events_targets.html","patterns\u002Fs3-bedrock-batch-inference-cdk",{"text":83},[84,85,86],"Upload the sample input file: \u003Ccode>aws s3 cp model_input\u002Finput.jsonl s3:\u002F\u002F{S3 bucket name}\u002Finput\u002F\u003C\u002Fcode>","Check batch inference job status: \u003Ccode>aws bedrock list-model-invocation-jobs | jq '.invocationJobSummaries[] | {jobArn, status, submitTime}'\u003C\u002Fcode>","Once completed (30+ minutes), check results in S3 bucket under 'output' prefix","rcEoFowuYln53uBSD0o_RFtjBOksOfWOY16ynLhlBwk",1779273338407]