-
Notifications
You must be signed in to change notification settings - Fork 1k
new serverless pattern - rekognition-s3-detecttext-python #2564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new serverless pattern - rekognition-s3-detecttext-python #2564
Conversation
| { | ||
| "title": "S3 to Rekognition using EventBridge", | ||
| "description": "SAM template for S3 trigger to invoke the Lambda function through an EventBridge rule for detection text in an image with Rekognition", | ||
| "language": "python", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python
|
|
||
| ## How it works | ||
|
|
||
| The Cloudformation template creates 2 S3 buckets (source and destination buckets) along with a Lambda function (Python) and an EventBridge event. The Lambda function is triggered by the EventBridge which listens to an object upload in the S3 bucket. The lambda function makes a DetectText API call to detect the text in an image and stores the output in the destination S3 bucket. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SAM template creates two S3 buckets (source and destination buckets) along with a Lambda function (Python) and an EventBridge rule. The Lambda function is triggered by s3 bucket object upload event. The Lambda function makes Rekognition DetectText API call to detect the text in an image and stores the output in the destination S3 bucket.
|
|
||
| 1. Delete the stack | ||
| ```bash | ||
| aws cloudformation delete-stack --stack-name STACK_NAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are old way of doing it. Use sam delete command. Also prior to deleting stack add commands to delete the contents from the bucket.
| @@ -0,0 +1,66 @@ | |||
| # Amazon S3 to Amazon Rekognition through AWS EventBridge | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS EventBridge --> Amazon EventBridge
| ``` | ||
|
|
||
| Replace the parameters in the above command appropriately. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a step for what to validate in the output bucket
| @@ -0,0 +1,66 @@ | |||
| # Amazon S3 to Amazon Rekognition through AWS EventBridge | |||
|
|
|||
| This pattern demonstrates how to create an S3 bucket which when uploaded with an object invokes a Lambda function through EventBridge. The function detects the text in a document through Amazon Rekognition. The lambda function is built using Python. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lambda function --> Lambda function
|
|
||
| Once you have run `sam deploy --guided` mode once and saved arguments to a configuration file (samconfig.toml), you can use `sam deploy` in future to use these defaults. | ||
|
|
||
| 1. Note the outputs from the SAM deployment process. These contain the resource names and/or ARNs which are used for testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sequence numbers 1, 2, 3.... :)
|
After internal review, it is decided that PR 2568 will be allowed for further review. Hence closing this PR. |
Issue #, if available: #2565
Description of changes:
This is a new PR created for a new serverless pattern that involves S3, Eventbridge, Lambda and Rekognition deployed using SAM that detects text in an image.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.