-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.yml
60 lines (60 loc) · 1.81 KB
/
template.yml
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
ROSTemplateFormatVersion: '2015-09-01'
Transform: 'Aliyun::Serverless-2018-04-03'
Resources:
face-recognition:
Type: 'Aliyun::Serverless::Service'
Properties:
Policies:
- Version: '1'
Statement:
- Effect: Allow
Action:
- 'oss:ListObjects'
- 'oss:GetObject'
- 'oss:PutObject'
- 'oss:DeleteObject'
- 'fnf:*'
Resource: '*'
listObjects:
Type: 'Aliyun::Serverless::Function'
Properties:
Handler: index.handler
Runtime: python3
Timeout: 60
MemorySize: 128
CodeUri: functions/listobjects
EnvironmentVariables:
OSS_ENDPOINT: 'https://oss-cn-hangzhou-internal.aliyuncs.com'
detectFaces:
Type: 'Aliyun::Serverless::Function'
Properties:
Handler: index.handler
Runtime: python3
Timeout: 60
MemorySize: 512
CodeUri: functions/detectfaces
EnvironmentVariables:
OSS_ENDPOINT: 'https://oss-cn-hangzhou-internal.aliyuncs.com'
timer:
Type: 'Aliyun::Serverless::Function'
Properties:
Handler: index.handler
Runtime: python3
Timeout: 60
MemorySize: 512
CodeUri: functions/timer
Events:
timeTrigger:
Type: Timer
Properties:
CronExpression: '0 * * * * *'
Enable: true
# replace YOUR_BUCKET_NAME to your oss bucket name
Payload: '{"flowName": "oss-batch-process", "input": "{\"bucket\": \"YOUR_BUCKET_NAME\",\"prefix\":\"\"}"}'
oss-batch-process:
Type: 'Aliyun::Serverless::Flow'
Properties:
Description: batch process flow
DefinitionUri: flows/index.flow.yml
Policies:
- AliyunFCInvocationAccess