-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
140 lines (130 loc) · 4.53 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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
dlp-access-lambda
collectionTitleEditFunction: This will modify the titles for IAWA sub-collections to NOT include identifiers to collection table.
createCollectionMapFunction: This will create JSON files in the CollectionMap-yourenv S3 Bucket and update collection and collectionmap tables.
createCollectionHeirarchyFunction: This will update collection heirarchy information to collection table.
createUpdateFunction: This will update archive, collection, and collectionmap table's createdAt, etc fields.
archiveCollectionHeirarchyFunction: This will update archive/collection heirarchy information to archive table.
Globals:
Function:
Timeout: 600
Parameters:
Region:
Type: String
Default: "us-east-1"
CollectionTable:
Type: String
Default: "Collection"
ArchiveTable:
Type: String
Default: "Archive"
CollectionmapTable:
Type: String
Default: "Collectionmap"
S3BucketName:
Type: String
Default: "collectionmapS3"
Resources:
archiveCollectionHeirarchyFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: apps/
Handler: archiveCollectionHeirarchy.lambda_handler
Runtime: python3.8
MemorySize: 2048
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref CollectionTable
- DynamoDBCrudPolicy:
TableName: !Ref ArchiveTable
Environment:
Variables:
REGION: !Ref Region
COLLECTIONTABLE_NAME: !Ref CollectionTable
ARCHIVETABLE_NAME: !Ref ArchiveTable
createUpdateFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: apps/
Handler: createUpdate.lambda_handler
Runtime: python3.8
MemorySize: 2048
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref CollectionTable
- DynamoDBCrudPolicy:
TableName: !Ref ArchiveTable
- DynamoDBCrudPolicy:
TableName: !Ref CollectionmapTable
Environment:
Variables:
REGION: !Ref Region
COLLECTIONTABLE_NAME: !Ref CollectionTable
ARCHIVETABLE_NAME: !Ref ArchiveTable
COLLECTIONMAPTABLE_NAME: !Ref CollectionmapTable
createCollectionMapFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: apps/
Handler: createCollectionMap.lambda_handler
Runtime: python3.8
MemorySize: 2048
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref CollectionTable
- DynamoDBCrudPolicy:
TableName: !Ref CollectionmapTable
- S3CrudPolicy:
BucketName: !Ref S3BucketName
Environment:
Variables:
REGION: !Ref Region
COLLECTIONTABLE_NAME: !Ref CollectionTable
COLLECTIONMAPTABLE_NAME: !Ref CollectionmapTable
COLLECTIONMAP_BUCKETNAME: !Ref S3BucketName
createCollectionHeirarchyFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: apps/
Handler: createCollectionHeirarchy.lambda_handler
Runtime: python3.8
MemorySize: 2048
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref CollectionTable
Environment:
Variables:
REGION: !Ref Region
COLLECTIONTABLE_NAME: !Ref CollectionTable
collectionTitleEditFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: apps/
Handler: collectionTitleEdit.lambda_handler
Runtime: python3.8
MemorySize: 2048
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref CollectionTable
Environment:
Variables:
REGION: !Ref Region
COLLECTIONTABLE_NAME: !Ref CollectionTable
Outputs:
archiveCollectionHeirarchyFunction:
Description: "archiveCollectionHeirarchy Lambda Function ARN"
Value: !GetAtt archiveCollectionHeirarchyFunction.Arn
createUpdateFunction:
Description: "createUpdate Lambda Function ARN"
Value: !GetAtt createUpdateFunction.Arn
createCollectionMapFunction:
Description: "createCollection Lambda Function ARN"
Value: !GetAtt createCollectionMapFunction.Arn
createCollectionHeirarchyFunction:
Description: "createCollectionHeirarchy Lambda Function ARN"
Value: !GetAtt createCollectionHeirarchyFunction.Arn
collectionTitleEditFunction:
Description: "collectionTitleEdit Lambda Function ARN"
Value: !GetAtt collectionTitleEditFunction.Arn