[{"data":1,"prerenderedAt":87},["ShallowReactive",2],{"pattern-s3-bedrock-data-automation-python-sam":3,"pattern-group-s3-bedrock-data-automation-python-sam":6},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":11,"deploy":13,"description":17,"extension":18,"framework":19,"gitHub":20,"highlight":6,"introBox":24,"language":32,"level":33,"meta":34,"patternArch":35,"patternGroup":62,"patternGroupLabel":6,"resources":63,"stem":81,"testing":82,"videoId":6,"__hash__":86},"patterns\u002Fpatterns\u002Fs3-bedrock-data-automation-python-sam.json","Extract structured data from documents with Amazon Bedrock Data Automation",null,{"text":8},[9,10],"Empty the Amazon S3 bucket: \u003Ccode>aws s3 rm s3:\u002F\u002FYOUR_BUCKET --recursive --region REGION_NAME\u003C\u002Fcode>.","Delete the stack with AWS SAM: \u003Ccode>sam delete --stack-name STACK_NAME --region REGION_NAME\u003C\u002Fcode>. Enter \u003Ccode>y\u003C\u002Fcode> at each confirmation prompt.",[12],"content\u002Fcontributors\u002Fmanish-s.json",{"text":14},[15,16],"\u003Ccode>sam build\u003C\u002Fcode>","\u003Ccode>sam deploy --guided\u003C\u002Fcode>","Turn files uploaded to Amazon S3 into structured JSON with Amazon Bedrock Data Automation and AWS Lambda, with no machine-learning code.","json","AWS SAM",{"template":21},{"patternPath":22,"templateFile":23},"s3-bedrock-data-automation\u002Fpython\u002Fsam","template.yaml",{"headline":25,"text":26},"How it works",[27,28,29,30,31],"Amazon Bedrock Data Automation (BDA) is a managed service that extracts structured information from unstructured content such as documents, images, video, and audio. This pattern wires it into an event-driven pipeline so that any file dropped into Amazon S3 is automatically turned into structured JSON, with no machine-learning code to write or maintain. Good use cases include invoice and form processing, contract and document understanding, media cataloging, and any workflow that needs to convert a pile of raw files into queryable data.","When a file is uploaded to the `input\u002F` prefix of the Amazon S3 bucket, the ObjectCreated event triggers an AWS Lambda function. The function calls the BDA runtime `InvokeDataAutomationAsync` API, passing the input file location, an output location, and the Amazon Bedrock Data Automation project that defines what to extract. The function is fire-and-forget: it only starts the asynchronous job and returns immediately, so it stays small and cheap.","Bedrock Data Automation reads the file, runs the managed extraction defined by the project, and writes the structured result to the `output\u002F` prefix of the same bucket. The project in this pattern uses a standard output configuration that returns each document as Markdown text (including tables) plus a generative summary. The project also processes image, video, and audio files with service defaults; you can add Image, Video, or Audio blocks to the project resource to control the standard output for those modalities, or attach a custom output configuration (a blueprint) that defines the exact fields you want.","The Amazon Bedrock Data Automation project is a native AWS CloudFormation resource (`AWS::Bedrock::DataAutomationProject`), so the entire pipeline is defined as infrastructure as code and the amount of custom code is minimal. AWS Identity and Access Management (IAM) permissions follow least privilege: the AWS Lambda function role may read only the `input\u002F` prefix of the pattern bucket, write only the `output\u002F` prefix, and invoke only the Bedrock Data Automation project that the stack creates.","The template picks the Amazon Bedrock Data Automation cross-Region inference profile for the deployment Region's geography (`us.`, `eu.` or `apac.data-automation-v1`), the IAM policy allows only that profile and the project the stack creates, and a CloudFormation `Rules` assertion stops the deployment early in a Region that offers none of those profiles. Because both Amazon S3 and AWS Lambda are pay-per-use and Bedrock Data Automation is fully managed, the pipeline scales to zero and has no idle cost. If the function cannot start a job for an upload, AWS Lambda retries the event twice and then sends it to an Amazon Simple Queue Service (Amazon SQS) queue, the function's on-failure destination, so the event is kept for inspection instead of discarded.","Python","200",{},{"icon1":36,"icon2":41,"icon3":45,"icon4":49,"line1":52,"line2":56,"line3":59},{"x":37,"y":38,"service":39,"label":40},12,45,"s3","Amazon S3\ninput\u002F",{"x":42,"y":38,"service":43,"label":44},37,"lambda-event-functions","AWS Lambda\nFunction",{"x":46,"y":38,"service":47,"label":48},63,"bedrock","Amazon Bedrock\nData Automation",{"x":50,"y":38,"service":39,"label":51},88,"Amazon S3\noutput\u002F",{"from":53,"to":54,"label":55},"icon1","icon2","Upload",{"from":54,"to":57,"label":58},"icon3","Start job",{"from":57,"to":60,"label":61},"icon4","JSON","s3-bedrock-data-automation",{"headline":64,"bullets":65},"Additional resources",[66,69,72,75,78],{"text":67,"link":68},"Amazon Bedrock Data Automation - documentation","https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock\u002Flatest\u002Fuserguide\u002Fbda.html",{"text":70,"link":71},"Cross Region support required for Bedrock Data Automation","https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock\u002Flatest\u002Fuserguide\u002Fbda-cris.html",{"text":73,"link":74},"AWS::Bedrock::DataAutomationProject - CloudFormation resource","https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSCloudFormation\u002Flatest\u002FTemplateReference\u002Faws-resource-bedrock-dataautomationproject.html",{"text":76,"link":77},"InvokeDataAutomationAsync - BDA runtime API","https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock\u002Flatest\u002FAPIReference\u002FAPI_data-automation-runtime_InvokeDataAutomationAsync.html",{"text":79,"link":80},"Using Amazon S3 notifications to trigger AWS Lambda","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fwith-s3.html","patterns\u002Fs3-bedrock-data-automation-python-sam",{"text":83},[84,85],"Set REGION to the Region you deployed to and BUCKET to the DataBucketName output, then upload the included sample-invoice.pdf to the input\u002F prefix: \u003Ccode>aws s3 cp .\u002Fsample-invoice.pdf s3:\u002F\u002F$BUCKET\u002Finput\u002Fsample-invoice.pdf --region $REGION\u003C\u002Fcode>.","List the structured JSON that Bedrock Data Automation writes to the output\u002F prefix: \u003Ccode>aws s3 ls s3:\u002F\u002F$BUCKET\u002Foutput\u002F --recursive --region $REGION\u003C\u002Fcode>. See the README for detailed instructions.","0Txa1YtnsjLnWYJlDcvkFq0CvAuAR7-FHBC875Jdync",1795189154505]