-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
69 lines (61 loc) · 1.67 KB
/
Copy pathtemplate.yaml
File metadata and controls
69 lines (61 loc) · 1.67 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
image_catalog
Sample SAM Template for image_catalog
Parameters:
BucketName:
Type: String
Default: daitawscloud-example
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 15
Resources:
ImageBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref BucketName
ImagesTable:
Type: AWS::Serverless::SimpleTable
Properties:
PrimaryKey:
Name: id
Type: String
ProvisionedThroughput:
ReadCapacityUnits: 2
WriteCapacityUnits: 2
ImageCatalogFunction:
Type: AWS::Serverless::Function
Properties:
PackageType: Image
Architectures:
- x86_64
Policies:
# Give Create/Read/Update/Delete Permissions to the SampleTable
- DynamoDBCrudPolicy:
TableName: !Ref ImagesTable
Environment:
Variables:
# Make table name accessible as environment variable from function code during execution
IMAGES_TABLE: !Ref ImagesTable
Events:
S3ObjectCreated:
Type: S3
Properties:
Bucket:
Ref: ImageBucket
Events: s3:ObjectCreated:*
Filter:
S3Key:
Rules:
- Name: suffix
Value: "png"
Metadata:
DockerTag: nodejs14.x-v1
DockerContext: ./imagecatalog
Dockerfile: Dockerfile
Outputs:
ImageCatalogFunction:
Description: "Hello World Lambda Function ARN"
Value: !GetAtt ImageCatalogFunction.Arn