Skip to content

Commit

Permalink
Update textract-pipeline-stack.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
darwaishx authored Aug 9, 2020
1 parent da0dd8f commit 7f41261
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions textract-pipeline/lib/textract-pipeline-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,20 @@ export class TextractPipelineStack extends cdk.Stack {
s3Processor.addLayers(helperLayer)
//Trigger
s3Processor.addEventSource(new S3EventSource(contentBucket, {

events: [ s3.EventType.OBJECT_CREATED ]
events: [ s3.EventType.OBJECT_CREATED ],
filters: [ { suffix: '.pdf' }]
}));
s3Processor.addEventSource(new S3EventSource(contentBucket, {
events: [ s3.EventType.OBJECT_CREATED ],
filters: [ { suffix: '.png' }]
}));
s3Processor.addEventSource(new S3EventSource(contentBucket, {
events: [ s3.EventType.OBJECT_CREATED ],
filters: [ { suffix: '.jpg' }]
}));
s3Processor.addEventSource(new S3EventSource(contentBucket, {
events: [ s3.EventType.OBJECT_CREATED ],
filters: [ { suffix: '.jpeg' }]
}));
//Permissions
documentsTable.grantReadWriteData(s3Processor)
Expand Down

0 comments on commit 7f41261

Please sign in to comment.