-
Notifications
You must be signed in to change notification settings - Fork 3
/
template.yaml
43 lines (42 loc) · 1.19 KB
/
template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Transform: 'AWS::Serverless-2016-10-31'
Parameters:
ElasticSearchEndpoint:
Description: 'ElasticSearch service endpoint'
Type: 'String'
Resources:
IndexerFunction:
Type: 'AWS::Serverless::Function'
Properties:
Description: 'Run Rekognition detect labels from S3 events and store results in ElasticSearch.'
Handler: lambda_function.lambda_handler
Runtime: python3.6
CodeUri: s3://khk-us-east-1/demos/serverless-app-repo/image-indexer.zip
Timeout: 30
Environment:
Variables:
ELASTICSEARCH_URL: !Ref ElasticSearchEndpoint
Events:
S3JpgEvent:
Type: S3
Properties:
Bucket: !Ref ImageBucket
Events: s3:ObjectCreated:*
Filter:
S3Key:
Rules:
-
Name: suffix
Value: jpg
S3PngEvent:
Type: S3
Properties:
Bucket: !Ref ImageBucket
Events: s3:ObjectCreated:*
Filter:
S3Key:
Rules:
-
Name: suffix
Value: png
ImageBucket:
Type: 'AWS::S3::Bucket'