aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/testHeat.yml
blob: d1eb621731e289994a1d2615215dd0bd41467868 (plain)
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
heat_template_version: 2013-05-23

description: vSeGW/vSRX Firewall Template

parameter_groups:
- label: System Settings
  description: System Level Settings
  parameters:
  - availability_zone_0
  - vnf_name
  - vnf_id

parameters:
  availability_zone_0:
    type: string
    description: Availability Zone
  vnf_name:
    type: string
    description: Unique name for this VNF instance
  vnf_id:
    type: string
    description: Unique ID for this VNF instance

# Note we are requesting a flavor with 10 physical CPU cores and may be limited by 16 vCPU flavor.
  flavor_segw_name:
    type: string
    description: flavor type
# The image will be provided as a qcow2 KVM image.
  image_segw_name:
    type: string
    description: Image use to boot a server

  flavor_vsrxfw_name:
    type: string
    description: flavor type
  image_vsrxfw_name:
    type: string
    description: Image use to boot a server
  
  INTERNET_direct_net_id:
    type: string
    description: The Internet

  oam_mgmt_net_0_id:
    type: string
    description: Name of OAM mgmt network

  oam_protected_net_0_id:
    type: string
    description: Name of OAM protected network

  Mobility_OAM_protected_net_0_id:
    type: string
    description: Network name for OAM

  GN_direct_net_0_id:
    type: string
    description: Network name for GN network

  Mobility_OAM_protected_net_1_id:
    type: string
    description: Network name for OAM

  GN_direct_net_1_id:
    type: string
    description: Network name for GN network

  HSL_direct_net_id:
    type: string
    description: Name of HSL (Logging) network
  HSL_direct_net_cidr:
    type: string
    description: HSL (Logging) network address (CIDR notation)

  int_dummi0_net_id:
    type: string
    description: Dummi Parent Network for port
  int_dummi1_net_id:
    type: string
    description: Dummi Parent Network for port
#  int_dummi2_net_id:
#    type: string
#    description: Dummi Parent Network for port
#  int_dummi3_net_id:
#    type: string
#    description: Dummi Parent Network for port
#  int_dummi4_net_id:
#    type: string
#    description: Dummi Parent Network for port
#  int_dummi5_net_id:
#    type: string
#    description: Dummi Parent Network for port

  int_dummi0_cidr:
    type: string
    description: IPv4 prefix (CIDR notation)
  int_dummi1_cidr:
    type: string
    description: IPv4 prefix (CIDR notation)
#  int_dummi2_cidr:
#    type: string
#    description: IPv4 prefix (CIDR notation)
#  int_dummi3_cidr:
#    type: string
#    description: IPv4 prefix (CIDR notation)
#  int_dummi4_cidr:
#    type: string
#    description: IPv4 prefix (CIDR notation)
#  int_dummi5_cidr:
#    type: string
#    description: IPv4 prefix (CIDR notation)

  segw_0_inet_ip_0:
    type: string
    label: segw_0 port ens10 Ingress IP address alias_0
    description: SeGW's Ingress interface IPv4 address, primary
  segw_0_inet_ip_1:
    type: string
    label: segw_0 port ens10 Ingress IP address alias_1
    description: SeGW's Ingress interface IPv4 address, alias 1
  segw_0_inet_ip_2:
    type: string
    label: segw_0 port ens10 Ingress IP address alias_2
    description: SeGW's Ingress interface IPv4 address, alias 2

  segw_1_inet_ip_0:
    type: string
    label: segw_1 port ens10 Ingress IP address alias_0
    description: SeGW's Ingress interface IPv4 address, primary
  segw_1_inet_ip_1:
    type: string
    label: segw_1 port ens10 Ingress IP address alias_1
    description: SeGW's Ingress interface IPv4 address, alias 1
  segw_1_inet_ip_2:
    type: string
    label: segw_1 port ens10 Ingress IP address alias_2
    description: SeGW's Ingress interface IPv4 address, alias 2
  segw_0_oam_protected_ip:
    type: string
    label: segw_0 OAM MGMT IP address
    description: segw_0 OAM MGMT IP address
  segw_1_oam_protected_ip:
    type: string
    label: segw_1 OAM MGMT IP address
    description: segw_1 OAM MGMT IP address

#  vsrx_fw_0_GN_direct_ip:
#    type: string
#    label: vsrx_fw_0 GN Direct IP address
#    description: vsrx_fw_0 GN Direct IP address
#  vsrx_fw_1_GN_direct_ip:
#    type: string
#    label: vsrx_fw_1 GN Direct IP address
#    description: vsrx_fw_1 GN Direct IP address
#  vsrx_fw_2_OAM_protected_ip:
#    type: string
#    label: vsrx_fw_2 OAM Protected IP address
#    description: vsrx_fw_2 OAM Protected IP address
#  vsrx_fw_3_OAM_protected_ip:
#    type: string
#    label: vsrx_fw_3 OAM Protected IP address
#    description: vsrx_fw_3 OAM Protected IP address
    
  segw_0_name:
    type: string
    default: vSeGW_0
    description: name of VM
  segw_1_name:
    type: string
    default: vSeGW_1
    description: name of VM    
  vsrx_fw_0_name:
    type: string
    default: vSRX_FW_0
    description: name of VM
  vsrx_fw_1_name:
    type: string
    default: vSRX_FW_1
    description: name of VM
  vsrx_fw_2_name:
    type: string
    default: vSRX_FW_2
    description: name of VM
  vsrx_fw_3_name:
    type: string
    default: vSRX_FW_3
    description: name of VM
  
  security_group_name:
    type: string
    label: SEGW security group name
    description: SEGW security group name

resources:

  SeGW_Affinity:
    type: OS::Nova::ServerGroup
    properties:
      policies: ["anti-affinity"]
  vSRXFW_Affinity:
    type: OS::Nova::ServerGroup
    properties:
      policies: ["anti-affinity"]

  Dummi0_net:
    type: OS::Contrail::VirtualNetwork
    properties:
      name: { get_param: int_dummi0_net_id }
  Dummi0_subnet:
    type: OS::Neutron::Subnet
    properties:
      network_id: { get_resource: Dummi0_net }
      cidr: { get_param: int_dummi0_cidr }

  Dummi1_net:
    type: OS::Contrail::VirtualNetwork
    properties:
      name: { get_param: int_dummi1_net_id }
  Dummi1_subnet:
    type: OS::Neutron::Subnet
    properties:
      network_id: { get_resource: Dummi1_net }
      cidr: { get_param: int_dummi1_cidr }

  hsl_direct_net:
    type: OS::Contrail::VirtualNetwork
    properties:
      name: { get_param: HSL_direct_net_id }

  hsl_ip_subnet:
    type: OS::Neutron::Subnet
    properties:
      network_id: { get_resource: hsl_direct_net }
      cidr: { get_param: HSL_direct_net_cidr }

  segw_security_group:
    type: OS::Neutron::SecurityGroup
    properties:
      description: vscp security group
      name: {get_param: security_group_name}
# Need to add any-any rule through GUI to get SCTP traffic to work - any-any rules are not supported in heat template
      rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
              {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
              {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
              {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
              {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
              {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
              ]

  server_segw_segw_0:
    type: OS::Nova::Server
    properties:
      name: { get_param: segw_0_name }
      image: { get_param: image_segw_name }
      availability_zone: { get_param: availability_zone_0 }
      flavor: { get_param: flavor_segw_name }
      scheduler_hints: { group: { get_resource: SeGW_Affinity } }
      networks:
      - port: { get_resource: port_segw_0_oam_protected }
      - port: { get_resource: port_segw_0_internet }
      - port: { get_resource: port_segw_0_dummi }
      metadata:
        vnf_id: { get_param: vnf_id }

  port_segw_0_oam_protected:
    type: OS::Neutron::Port
    properties:
      network: { get_param: oam_protected_net_0_id }
      fixed_ips: [{"ip_address": {get_param: segw_0_oam_protected_ip}}]
      security_groups: [{get_resource: segw_security_group}]

  port_segw_0_internet:
    type: OS::Neutron::Port
    properties:
      network: { get_param: INTERNET_direct_net_id }
      fixed_ips: [{"ip_address": {get_param: segw_0_inet_ip_0}}, {"ip_address": {get_param: segw_0_inet_ip_1}}, {"ip_address": {get_param: segw_0_inet_ip_2}}]
      security_groups: [{get_resource: segw_security_group}]

  port_segw_0_dummi:
    type: OS::Neutron::Port
    properties:
      network: { get_resource: Dummi0_net }
      security_groups: [{get_resource: segw_security_group}]

  server_segw_segw_1:
    type: OS::Nova::Server
    properties:
      name: { get_param: segw_1_name }
      image: { get_param: image_segw_name }
      availability_zone: { get_param: availability_zone_0 }
      flavor: { get_param: flavor_segw_name }
      scheduler_hints: { group: { get_resource: SeGW_Affinity } }
      networks:
      - port: { get_resource: port_segw_1_oam_protected }
      - port: { get_resource: port_segw_1_internet }
      - port: { get_resource: port_segw_1_dummi }
      metadata:
        vnf_id: { get_param: vnf_id }

  port_segw_1_oam_protected:
    type: OS::Neutron::Port
    properties:
      network: { get_param: oam_protected_net_0_id }
      fixed_ips: [{"ip_address": {get_param: segw_1_oam_protected_ip}}]
      security_groups: [{get_resource: segw_security_group}]

  port_segw_1_internet:
    type: OS::Neutron::Port
    properties:
      network: { get_param: INTERNET_direct_net_id }
      fixed_ips: [{"ip_address": {get_param: segw_1_inet_ip_0}}, {"ip_address": {get_param: segw_1_inet_ip_1}}, {"ip_address": {get_param: segw_1_inet_ip_2}}]
      security_groups: [{get_resource: segw_security_group}]

  port_segw_1_dummi:
    type: OS::Neutron::Port
    properties:
      network: { get_resource: Dummi1_net }
      security_groups: [{get_resource: segw_security_group}]

  server_vsrx_fw_0:
    type: OS::Nova::Server
    properties:
      name: { get_param: vsrx_fw_0_name }
      image: { get_param: image_vsrxfw_name }
      availability_zone: { get_param: availability_zone_0 }
      flavor: { get_param: flavor_vsrxfw_name }
      scheduler_hints: { group: { get_resource: vSRXFW_Affinity } }
      networks:
      - port: { get_resource: port_vsrx_fw_0_oam_mgmt }
      - port: { get_resource: port_vsrx_fw_0_dummi }
      - port: { get_resource: port_vsrx_fw_0_GN }
      - port: { get_resource: port_vsrx_fw_0_HSL }

      metadata:
        vnf_id: { get_param: vnf_id }

  port_vsrx_fw_0_oam_mgmt:
    type: OS::Neutron::Port
    properties:
      network: { get_param: oam_mgmt_net_0_id }
      security_groups: [{get_resource: segw_security_group}]

  port_vsrx_fw_0_dummi:
    type: OS::Neutron::Port
    properties:
      network: { get_resource: Dummi0_net }
      security_groups: [{get_resource: segw_security_group}]

  port_vsrx_fw_0_GN:
    type: OS::Neutron::Port
    properties:
      network: { get_param: GN_direct_net_0_id }
#      fixed_ips: [{"ip_address": {get_param: vsrx_fw_0_GN_direct_ip}}]
      security_groups: [{get_resource: segw_security_group}]

  port_vsrx_fw_0_HSL:
    type: OS::Neutron::Port
    properties:
      network: { get_resource: hsl_direct_net }
      security_groups: [{get_resource: segw_security_group}]

  server_vsrx_fw_1:
    type: OS::Nova::Server
    properties:
      name: { get_param: vsrx_fw_1_name }
      image: { get_param: image_vsrxfw_name }
      availability_zone: { get_param: availability_zone_0 }
      flavor: { get_param: flavor_vsrxfw_name }
      scheduler_hints: { group: { get_resource: vSRXFW_Affinity } }
      networks:
      - port: { get_resource: port_vsrx_fw_1_oam_mgmt }
      - port: { get_resource: port_vsrx_fw_1_dummi }
      - port: { get_resource: port_vsrx_fw_1_GN }
      - port: { get_resource: port_vsrx_fw_1_HSL }

      metadata:
        vnf_id: { get_param: vnf_id }

  port_vsrx_fw_1_oam_mgmt:
    type: OS::Neutron::Port
    properties:
      network: { get_param: oam_mgmt_net_0_id }
      security_groups: [{get_resource: segw_security_group}]

  port_vsrx_fw_1_dummi:
    type: OS::Neutron::Port
    properties:
      network: { get_resource: Dummi1_net }
      security_groups: [{get_resource: segw_security_group}]

  port_vsrx_fw_1_GN:
    type: OS::Neutron::Port
    properties:
      network: { get_param: GN_direct_net_1_id }
#      fixed_ips: [{"ip_address": {get_param: vsrx_fw_1_GN_direct_ip}}]
      security_groups: [{get_resource: segw_security_group}]

  port_vsrx_fw_1_HSL:
    type: OS::Neutron::Port
    properties:
      network: { get_resource: hsl_direct_net }
      security_groups: [{get_resource: segw_security_group}]

  server_vsrx_fw_2:
    type: OS::Nova::Server
    properties:
      name: { get_param: vsrx_fw_2_name }
      image: { get_param: image_vsrxfw_name }
      availability_zone: { get_param: availability_zone_0 }
      flavor: { get_param: flavor_vsrxfw_name }
      scheduler_hints: { group: { get_resource: vSRXFW_Affinity } }
      networks:
      - port: { get_resource: port_vsrx_fw_2_oam_mgmt }
      - port: { get_resource: port_vsrx_fw_2_dummi }
      - port: { get_resource: port_vsrx_fw_2_OAM }
      - port: { get_resource: port_vsrx_fw_2_HSL }

      metadata:
        vnf_id: { get_param: vnf_id }

  port_vsrx_fw_2_oam_mgmt:
    type: OS::Neutron::Port
    properties:
      network: { get_param: oam_mgmt_net_0_id }
      security_groups: [{get_resource: segw_security_group}]

  port_vsrx_fw_2_dummi:
    type: OS::Neutron::Port
    properties:
      network: { get_resource: Dummi0_net }
      security_groups: [{get_resource: segw_security_group}]

  port_vsrx_fw_2_OAM:
    type: OS::Neutron::Port
    properties:
      network: { get_param: Mobility_OAM_protected_net_0_id }
#      fixed_ips: [{"ip_address": {get_param: vsrx_fw_2_OAM_protected_ip}}]
      security_groups: [{get_resource: segw_security_group}]

  port_vsrx_fw_2_HSL:
    type: OS::Neutron::Port
    properties:
      network: { get_resource: hsl_direct_net }
      security_groups: [{get_resource: segw_security_group}]

  server_vsrx_fw_3:
    type: OS::Nova::Server
    properties:
      name: { get_param: vsrx_fw_3_name }
      image: { get_param: image_vsrxfw_name }
      availability_zone: { get_param: availability_zone_0 }
      flavor: { get_param: flavor_vsrxfw_name }
      scheduler_hints: { group: { get_resource: vSRXFW_Affinity } }
      networks:
      - port: { get_resource: port_vsrx_fw_3_oam_mgmt }
      - port: { get_resource: port_vsrx_fw_3_dummi }
      - port: { get_resource: port_vsrx_fw_3_OAM }
      - port: { get_resource: port_vsrx_fw_3_HSL }

      metadata:
        vnf_id: { get_param: vnf_id }

  port_vsrx_fw_3_oam_mgmt:
    type: OS::Neutron::Port
    properties:
      network: { get_param: oam_mgmt_net_0_id }
      security_groups: [{get_resource: segw_security_group}]

  port_vsrx_fw_3_dummi:
    type: OS::Neutron::Port
    properties:
      network: { get_resource: Dummi1_net }
      security_groups: [{get_resource: segw_security_group}]

  port_vsrx_fw_3_OAM:
    type: OS::Neutron::Port
    properties:
      network: { get_param: Mobility_OAM_protected_net_1_id }
#      fixed_ips: [{"ip_address": {get_param: vsrx_fw_3_OAM_protected_ip}}]
      security_groups: [{get_resource: segw_security_group}]

  port_vsrx_fw_3_HSL:
    type: OS::Neutron::Port
    properties:
      network: { get_resource: hsl_direct_net }
      security_groups: [{get_resource: segw_security_group}]

conditions:
  cd1: True
  cd2:
    get_param: param1
  cd3:
    equals:
    - get_param: param2
    - yes
  cd4:
    not:
      equals:
      - get_param: param3
      - yes
  cd5:
    and:
    - equals:
      - get_param: env_type
      - prod
    - not:
        equals:
        - get_param: zone
        - beijing
  cd6:
    or:
    - equals:
      - get_param: zone
      - shanghai
    - equals:
      - get_param: zone
      - beijing
  cd7:
    not: cd4
  cd8:
    and:
    - cd1
    - cd2
  create_prod_res: {equals : [{get_param: env_type}, "prod"]}