-
Notifications
You must be signed in to change notification settings - Fork 35
/
function-invoker.yml
165 lines (165 loc) · 3.37 KB
/
function-invoker.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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建FC服务、函数、触发器、版本、别名及配置,支持定时触发及函数调用。
en: Create FC services, functions, triggers, versions, aliases, and configurations,
supporting scheduled triggers and function invocations.
Parameters:
AliasName:
Type: String
Default: TEST
ServiceName:
Type: String
Description: FC ServiceName
Default: mytest
SourceCode:
Type: String
Description: Function SourceCode
Default: "def handler(event, context):\n\treturn 'Hello World!'"
Handler:
Type: String
Description: Handler
Default: index.handler
Runtime:
Type: String
Description: Runtime
Default: python3
FunctionName:
Type: String
Description: Function Name
Default: PythonFunc
ExecuteVersion:
Type: Number
Default: 1.0
TriggerName:
Type: String
Default: mytest
TriggerType:
Type: String
Default: timer
Interval:
Type: String
Description: Time interval of Trigger.
Default: '2'
Resources:
Service:
Type: ALIYUN::FC::Service
Properties:
ServiceName:
Ref: ServiceName
Function:
Type: ALIYUN::FC::Function
Properties:
ServiceName:
Ref: ServiceName
Code:
SourceCode:
Ref: SourceCode
Handler:
Ref: Handler
Runtime:
Ref: Runtime
FunctionName:
Ref: FunctionName
DependsOn: Service
Trigger:
Type: ALIYUN::FC::Trigger
Properties:
ServiceName:
Ref: ServiceName
FunctionName:
Ref: FunctionName
TriggerName:
Ref: TriggerName
TriggerType:
Ref: TriggerType
TriggerConfig:
Enable: true
CronExpression: 0 0/4 * * * *
DependsOn: Function
FunctionInvoker:
Type: ALIYUN::FC::FunctionInvoker
Properties:
ServiceName:
Ref: ServiceName
FunctionName:
Ref: FunctionName
ExecuteVersion:
Ref: ExecuteVersion
DependsOn: Trigger
Version:
Type: ALIYUN::FC::Version
Properties:
ServiceName:
Fn::GetAtt:
- Service
- ServiceName
Description: Test Version
DependsOn: Function
Alias:
Type: ALIYUN::FC::Alias
Properties:
Description: Test Alias
VersionId:
Fn::GetAtt:
- Version
- VersionId
ServiceName:
Fn::GetAtt:
- Service
- ServiceName
AliasName:
Ref: AliasName
DependsOn: Version
ProvisionConfig:
Type: ALIYUN::FC::ProvisionConfig
Properties:
ServiceName:
Fn::GetAtt:
- Service
- ServiceName
Target: 1
FunctionName:
Fn::GetAtt:
- Function
- FunctionName
Qualifier:
Fn::GetAtt:
- Alias
- AliasName
DependsOn: Alias
Outputs:
AliasName:
Value:
Fn::GetAtt:
- Alias
- AliasName
VersionId:
Value:
Fn::GetAtt:
- Version
- VersionId
ServiceId:
Value:
Fn::GetAtt:
- Service
- ServiceId
FunctionId:
Value:
Fn::GetAtt:
- Function
- FunctionId
ResultType:
Value:
Fn::GetAtt:
- FunctionInvoker
- ResultType
Result:
Value:
Fn::GetAtt:
- FunctionInvoker
- Result
TriggerId:
Value:
Fn::GetAtt:
- Trigger
- TriggerId