forked from radon-h2020/radon-demonstrator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathServiceTemplate.tosca
287 lines (286 loc) · 8.37 KB
/
ServiceTemplate.tosca
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
tosca_definitions_version: tosca_simple_yaml_1_3
metadata:
targetNamespace: "radon.blueprints.testing"
topology_template:
node_templates:
AwsLambdaFunction_1:
type: radon.nodes.aws.AwsLambdaFunction
metadata:
x: "893"
y: "113"
displayName: "GetTodoItem"
properties:
handler: "get.handler"
memory: 128
name: "get-item"
runtime: "nodejs12.x"
alias: "dev"
statement_id: "get-stmt"
zip_file: { get_artifact: [ SELF, get_item ] }
timeout: 300
env_vars:
TODOS_TABLE: "items"
requirements:
- endpoint:
node: AwsDynamoDBTable_0
relationship: con_ConnectsTo_1
capability: database_endpoint
- host:
node: AwsPlatform_0
relationship: con_HostedOn_3
capability: host
artifacts:
get_item:
type: radon.artifacts.archive.Zip
file: get.zip
AwsLambdaFunction_2:
type: radon.nodes.aws.AwsLambdaFunction
metadata:
x: "893"
y: "208"
displayName: "CreateTodoItem"
properties:
handler: "create.handler"
memory: 128
name: "create-item"
runtime: "nodejs12.x"
alias: "dev"
statement_id: "create-stmt"
zip_file: { get_artifact: [ SELF, create_item ] }
timeout: 300
env_vars:
TODOS_TABLE: "items"
requirements:
- endpoint:
node: AwsDynamoDBTable_0
relationship: con_ConnectsTo_2
capability: database_endpoint
- host:
node: AwsPlatform_0
relationship: con_HostedOn_4
capability: host
artifacts:
create_item:
type: radon.artifacts.archive.Zip
file: create.zip
AwsDynamoDBTable_0:
type: radon.nodes.aws.AwsDynamoDBTable
metadata:
x: "1514"
y: "301"
displayName: "ItemsTable"
properties:
hash_key_name: "id"
read_capacity: 1
name: "items"
write_capacity: 1
hash_key_type: "STRING"
requirements:
- host:
node: AwsPlatform_0
relationship: con_HostedOn_0
capability: host
AwsLambdaFunction_0:
type: radon.nodes.aws.AwsLambdaFunction
metadata:
x: "893"
y: "304"
displayName: "ListTodoItem"
properties:
handler: "list.handler"
memory: 128
name: "list-item"
runtime: "nodejs12.x"
alias: "dev"
statement_id: "list-stmt"
zip_file: { get_artifact: [ SELF, list_items ] }
timeout: 300
concurrency: 0
env_vars:
TODOS_TABLE: "items"
requirements:
- endpoint:
node: AwsDynamoDBTable_0
relationship: con_ConnectsTo_0
capability: database_endpoint
- host:
node: AwsPlatform_0
relationship: con_HostedOn_1
capability: host
artifacts:
list_items:
type: radon.artifacts.archive.Zip
file: list.zip
AwsLambdaFunction_3:
type: radon.nodes.aws.AwsLambdaFunction
metadata:
x: "888"
y: "398"
displayName: "UpdateTodoItem"
properties:
handler: "update.handler"
memory: 128
name: "update-item"
runtime: "nodejs12.x"
alias: "dev"
statement_id: "update-stmt"
zip_file: { get_artifact: [ SELF, update_item ] }
timeout: 300
env_vars:
TODOS_TABLE: "items"
requirements:
- endpoint:
node: AwsDynamoDBTable_0
relationship: con_ConnectsTo_3
capability: database_endpoint
- host:
node: AwsPlatform_0
relationship: con_HostedOn_5
capability: host
artifacts:
update_item:
type: radon.artifacts.archive.Zip
file: update.zip
AwsPlatform_0:
type: radon.nodes.aws.AwsPlatform
metadata:
x: "549"
y: "589"
displayName: "AwsPlatform"
properties:
name: "AWS"
region: "eu-central-1"
AwsLambdaFunction_4:
type: radon.nodes.aws.AwsLambdaFunction
metadata:
x: "888"
y: "499"
displayName: "DeleteTodoItem"
properties:
handler: "delete.handler"
memory: 128
name: "delete-item"
runtime: "nodejs12.x"
alias: "dev"
statement_id: "delete-stmt"
zip_file: { get_artifact: [ SELF, delete_item ] }
timeout: 300
env_vars:
TODOS_TABLE: "items"
requirements:
- endpoint:
node: AwsDynamoDBTable_0
relationship: con_ConnectsTo_4
capability: database_endpoint
- host:
node: AwsPlatform_0
relationship: con_HostedOn_6
capability: host
artifacts:
delete_item:
type: radon.artifacts.archive.Zip
file: delete.zip
AwsApiGateway_0:
type: radon.nodes.aws.AwsApiGateway
metadata:
x: "355"
y: "300"
displayName: "AwsApiGateway"
properties:
name: "ServerlessToDoListAPI"
api_version: "1.0.0"
api_description: "a simple serverless API example"
requirements:
- host:
node: AwsPlatform_0
relationship: con_HostedOn_2
capability: host
- invoker:
node: AwsLambdaFunction_0
relationship: con_AwsApiGatewayTriggers_0
capability: invocable
- invoker:
node: AwsLambdaFunction_1
relationship: con_AwsApiGatewayTriggers_1
capability: invocable
- invoker:
node: AwsLambdaFunction_2
relationship: con_AwsApiGatewayTriggers_2
capability: invocable
- invoker:
node: AwsLambdaFunction_3
relationship: con_AwsApiGatewayTriggers_3
capability: invocable
- invoker:
node: AwsLambdaFunction_4
relationship: con_AwsApiGatewayTriggers_4
capability: invocable
relationship_templates:
con_HostedOn_2:
type: tosca.relationships.HostedOn
con_HostedOn_3:
type: tosca.relationships.HostedOn
con_HostedOn_0:
type: tosca.relationships.HostedOn
con_HostedOn_1:
type: tosca.relationships.HostedOn
con_HostedOn_6:
type: tosca.relationships.HostedOn
con_HostedOn_4:
type: tosca.relationships.HostedOn
con_HostedOn_5:
type: tosca.relationships.HostedOn
con_ConnectsTo_2:
type: radon.relationships.ConnectsTo
con_ConnectsTo_3:
type: radon.relationships.ConnectsTo
con_ConnectsTo_4:
type: radon.relationships.ConnectsTo
con_AwsApiGatewayTriggers_4:
type: radon.relationships.aws.AwsApiGatewayTriggers
properties:
endpoint: "/todos/{id}"
http_methods: "delete"
con_AwsApiGatewayTriggers_3:
type: radon.relationships.aws.AwsApiGatewayTriggers
properties:
endpoint: "/todos/{id}"
http_methods: "put"
con_ConnectsTo_0:
type: radon.relationships.ConnectsTo
con_AwsApiGatewayTriggers_2:
type: radon.relationships.aws.AwsApiGatewayTriggers
properties:
endpoint: "/todos"
http_methods: "post"
con_ConnectsTo_1:
type: radon.relationships.ConnectsTo
con_AwsApiGatewayTriggers_1:
type: radon.relationships.aws.AwsApiGatewayTriggers
properties:
endpoint: "/todos/{id}"
http_methods: "get"
con_AwsApiGatewayTriggers_0:
type: radon.relationships.aws.AwsApiGatewayTriggers
properties:
endpoint: "/todos"
http_methods: "get"
policies:
- exampleTestPolicy:
type: radon.policies.testing.HttpEndpointTest
properties:
path: "/"
hostname: "google.com"
method: "GET"
port: "443"
expected_status: "200"
ti_blueprint: "radon.blueprints.testing.DeploymentTestAgentEC2"
use_https: "true"
test_id: "exampleTest"
targets: [ AwsLambdaFunction_0 ]
outputs:
testing_endpoint:
type: string
description: Endpoint that is used for testing
required: false
default: { concat: [ { get_attribute: [ AwsApiGateway_0, endpoint_url ] }, { get_property: [ con_AwsApiGatewayTriggers_0, endpoint ] } ] }