push addional code
[sdc.git] / openecomp-be / lib / openecomp-heat-lib / src / test / resources / mock / model / testHeat.yml
1 heat_template_version: 2013-05-23
2
3 description: vSeGW/vSRX Firewall Template
4
5 parameter_groups:
6 - label: System Settings
7   description: System Level Settings
8   parameters:
9   - availability_zone_0
10   - vnf_name
11   - vnf_id
12
13 parameters:
14   availability_zone_0:
15     type: string
16     description: Availability Zone
17   vnf_name:
18     type: string
19     description: Unique name for this VNF instance
20   vnf_id:
21     type: string
22     description: Unique ID for this VNF instance
23
24 # Note we are requesting a flavor with 10 physical CPU cores and may be limited by 16 vCPU flavor.
25   flavor_segw_name:
26     type: string
27     description: flavor type
28 # The image will be provided as a qcow2 KVM image.
29   image_segw_name:
30     type: string
31     description: Image use to boot a server
32
33   flavor_vsrxfw_name:
34     type: string
35     description: flavor type
36   image_vsrxfw_name:
37     type: string
38     description: Image use to boot a server
39   
40   INTERNET_direct_net_id:
41     type: string
42     description: The Internet
43
44   oam_mgmt_net_0_id:
45     type: string
46     description: Name of OAM mgmt network
47
48   oam_protected_net_0_id:
49     type: string
50     description: Name of OAM protected network
51
52   Mobility_OAM_protected_net_0_id:
53     type: string
54     description: Network name for OAM
55
56   GN_direct_net_0_id:
57     type: string
58     description: Network name for GN network
59
60   Mobility_OAM_protected_net_1_id:
61     type: string
62     description: Network name for OAM
63
64   GN_direct_net_1_id:
65     type: string
66     description: Network name for GN network
67
68   HSL_direct_net_id:
69     type: string
70     description: Name of HSL (Logging) network
71   HSL_direct_net_cidr:
72     type: string
73     description: HSL (Logging) network address (CIDR notation)
74
75   int_dummi0_net_id:
76     type: string
77     description: Dummi Parent Network for port
78   int_dummi1_net_id:
79     type: string
80     description: Dummi Parent Network for port
81 #  int_dummi2_net_id:
82 #    type: string
83 #    description: Dummi Parent Network for port
84 #  int_dummi3_net_id:
85 #    type: string
86 #    description: Dummi Parent Network for port
87 #  int_dummi4_net_id:
88 #    type: string
89 #    description: Dummi Parent Network for port
90 #  int_dummi5_net_id:
91 #    type: string
92 #    description: Dummi Parent Network for port
93
94   int_dummi0_cidr:
95     type: string
96     description: IPv4 prefix (CIDR notation)
97   int_dummi1_cidr:
98     type: string
99     description: IPv4 prefix (CIDR notation)
100 #  int_dummi2_cidr:
101 #    type: string
102 #    description: IPv4 prefix (CIDR notation)
103 #  int_dummi3_cidr:
104 #    type: string
105 #    description: IPv4 prefix (CIDR notation)
106 #  int_dummi4_cidr:
107 #    type: string
108 #    description: IPv4 prefix (CIDR notation)
109 #  int_dummi5_cidr:
110 #    type: string
111 #    description: IPv4 prefix (CIDR notation)
112
113   segw_0_inet_ip_0:
114     type: string
115     label: segw_0 port ens10 Ingress IP address alias_0
116     description: SeGW's Ingress interface IPv4 address, primary
117   segw_0_inet_ip_1:
118     type: string
119     label: segw_0 port ens10 Ingress IP address alias_1
120     description: SeGW's Ingress interface IPv4 address, alias 1
121   segw_0_inet_ip_2:
122     type: string
123     label: segw_0 port ens10 Ingress IP address alias_2
124     description: SeGW's Ingress interface IPv4 address, alias 2
125
126   segw_1_inet_ip_0:
127     type: string
128     label: segw_1 port ens10 Ingress IP address alias_0
129     description: SeGW's Ingress interface IPv4 address, primary
130   segw_1_inet_ip_1:
131     type: string
132     label: segw_1 port ens10 Ingress IP address alias_1
133     description: SeGW's Ingress interface IPv4 address, alias 1
134   segw_1_inet_ip_2:
135     type: string
136     label: segw_1 port ens10 Ingress IP address alias_2
137     description: SeGW's Ingress interface IPv4 address, alias 2
138   segw_0_oam_protected_ip:
139     type: string
140     label: segw_0 OAM MGMT IP address
141     description: segw_0 OAM MGMT IP address
142   segw_1_oam_protected_ip:
143     type: string
144     label: segw_1 OAM MGMT IP address
145     description: segw_1 OAM MGMT IP address
146
147 #  vsrx_fw_0_GN_direct_ip:
148 #    type: string
149 #    label: vsrx_fw_0 GN Direct IP address
150 #    description: vsrx_fw_0 GN Direct IP address
151 #  vsrx_fw_1_GN_direct_ip:
152 #    type: string
153 #    label: vsrx_fw_1 GN Direct IP address
154 #    description: vsrx_fw_1 GN Direct IP address
155 #  vsrx_fw_2_OAM_protected_ip:
156 #    type: string
157 #    label: vsrx_fw_2 OAM Protected IP address
158 #    description: vsrx_fw_2 OAM Protected IP address
159 #  vsrx_fw_3_OAM_protected_ip:
160 #    type: string
161 #    label: vsrx_fw_3 OAM Protected IP address
162 #    description: vsrx_fw_3 OAM Protected IP address
163     
164   segw_0_name:
165     type: string
166     default: vSeGW_0
167     description: name of VM
168   segw_1_name:
169     type: string
170     default: vSeGW_1
171     description: name of VM    
172   vsrx_fw_0_name:
173     type: string
174     default: vSRX_FW_0
175     description: name of VM
176   vsrx_fw_1_name:
177     type: string
178     default: vSRX_FW_1
179     description: name of VM
180   vsrx_fw_2_name:
181     type: string
182     default: vSRX_FW_2
183     description: name of VM
184   vsrx_fw_3_name:
185     type: string
186     default: vSRX_FW_3
187     description: name of VM
188   
189   security_group_name:
190     type: string
191     label: SEGW security group name
192     description: SEGW security group name
193
194 resources:
195
196   SeGW_Affinity:
197     type: OS::Nova::ServerGroup
198     properties:
199       policies: ["anti-affinity"]
200   vSRXFW_Affinity:
201     type: OS::Nova::ServerGroup
202     properties:
203       policies: ["anti-affinity"]
204
205   Dummi0_net:
206     type: OS::Contrail::VirtualNetwork
207     properties:
208       name: { get_param: int_dummi0_net_id }
209   Dummi0_subnet:
210     type: OS::Neutron::Subnet
211     properties:
212       network_id: { get_resource: Dummi0_net }
213       cidr: { get_param: int_dummi0_cidr }
214
215   Dummi1_net:
216     type: OS::Contrail::VirtualNetwork
217     properties:
218       name: { get_param: int_dummi1_net_id }
219   Dummi1_subnet:
220     type: OS::Neutron::Subnet
221     properties:
222       network_id: { get_resource: Dummi1_net }
223       cidr: { get_param: int_dummi1_cidr }
224
225   hsl_direct_net:
226     type: OS::Contrail::VirtualNetwork
227     properties:
228       name: { get_param: HSL_direct_net_id }
229
230   hsl_ip_subnet:
231     type: OS::Neutron::Subnet
232     properties:
233       network_id: { get_resource: hsl_direct_net }
234       cidr: { get_param: HSL_direct_net_cidr }
235
236   segw_security_group:
237     type: OS::Neutron::SecurityGroup
238     properties:
239       description: vscp security group
240       name: {get_param: security_group_name}
241 # Need to add any-any rule through GUI to get SCTP traffic to work - any-any rules are not supported in heat template
242       rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
243               {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
244               {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0},
245               {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0},
246               {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0},
247               {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}
248               ]
249
250   server_segw_segw_0:
251     type: OS::Nova::Server
252     properties:
253       name: { get_param: segw_0_name }
254       image: { get_param: image_segw_name }
255       availability_zone: { get_param: availability_zone_0 }
256       flavor: { get_param: flavor_segw_name }
257       scheduler_hints: { group: { get_resource: SeGW_Affinity } }
258       networks:
259       - port: { get_resource: port_segw_0_oam_protected }
260       - port: { get_resource: port_segw_0_internet }
261       - port: { get_resource: port_segw_0_dummi }
262       metadata:
263         vnf_id: { get_param: vnf_id }
264
265   port_segw_0_oam_protected:
266     type: OS::Neutron::Port
267     properties:
268       network: { get_param: oam_protected_net_0_id }
269       fixed_ips: [{"ip_address": {get_param: segw_0_oam_protected_ip}}]
270       security_groups: [{get_resource: segw_security_group}]
271
272   port_segw_0_internet:
273     type: OS::Neutron::Port
274     properties:
275       network: { get_param: INTERNET_direct_net_id }
276       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}}]
277       security_groups: [{get_resource: segw_security_group}]
278
279   port_segw_0_dummi:
280     type: OS::Neutron::Port
281     properties:
282       network: { get_resource: Dummi0_net }
283       security_groups: [{get_resource: segw_security_group}]
284
285   server_segw_segw_1:
286     type: OS::Nova::Server
287     properties:
288       name: { get_param: segw_1_name }
289       image: { get_param: image_segw_name }
290       availability_zone: { get_param: availability_zone_0 }
291       flavor: { get_param: flavor_segw_name }
292       scheduler_hints: { group: { get_resource: SeGW_Affinity } }
293       networks:
294       - port: { get_resource: port_segw_1_oam_protected }
295       - port: { get_resource: port_segw_1_internet }
296       - port: { get_resource: port_segw_1_dummi }
297       metadata:
298         vnf_id: { get_param: vnf_id }
299
300   port_segw_1_oam_protected:
301     type: OS::Neutron::Port
302     properties:
303       network: { get_param: oam_protected_net_0_id }
304       fixed_ips: [{"ip_address": {get_param: segw_1_oam_protected_ip}}]
305       security_groups: [{get_resource: segw_security_group}]
306
307   port_segw_1_internet:
308     type: OS::Neutron::Port
309     properties:
310       network: { get_param: INTERNET_direct_net_id }
311       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}}]
312       security_groups: [{get_resource: segw_security_group}]
313
314   port_segw_1_dummi:
315     type: OS::Neutron::Port
316     properties:
317       network: { get_resource: Dummi1_net }
318       security_groups: [{get_resource: segw_security_group}]
319
320   server_vsrx_fw_0:
321     type: OS::Nova::Server
322     properties:
323       name: { get_param: vsrx_fw_0_name }
324       image: { get_param: image_vsrxfw_name }
325       availability_zone: { get_param: availability_zone_0 }
326       flavor: { get_param: flavor_vsrxfw_name }
327       scheduler_hints: { group: { get_resource: vSRXFW_Affinity } }
328       networks:
329       - port: { get_resource: port_vsrx_fw_0_oam_mgmt }
330       - port: { get_resource: port_vsrx_fw_0_dummi }
331       - port: { get_resource: port_vsrx_fw_0_GN }
332       - port: { get_resource: port_vsrx_fw_0_HSL }
333
334       metadata:
335         vnf_id: { get_param: vnf_id }
336
337   port_vsrx_fw_0_oam_mgmt:
338     type: OS::Neutron::Port
339     properties:
340       network: { get_param: oam_mgmt_net_0_id }
341       security_groups: [{get_resource: segw_security_group}]
342
343   port_vsrx_fw_0_dummi:
344     type: OS::Neutron::Port
345     properties:
346       network: { get_resource: Dummi0_net }
347       security_groups: [{get_resource: segw_security_group}]
348
349   port_vsrx_fw_0_GN:
350     type: OS::Neutron::Port
351     properties:
352       network: { get_param: GN_direct_net_0_id }
353 #      fixed_ips: [{"ip_address": {get_param: vsrx_fw_0_GN_direct_ip}}]
354       security_groups: [{get_resource: segw_security_group}]
355
356   port_vsrx_fw_0_HSL:
357     type: OS::Neutron::Port
358     properties:
359       network: { get_resource: hsl_direct_net }
360       security_groups: [{get_resource: segw_security_group}]
361
362   server_vsrx_fw_1:
363     type: OS::Nova::Server
364     properties:
365       name: { get_param: vsrx_fw_1_name }
366       image: { get_param: image_vsrxfw_name }
367       availability_zone: { get_param: availability_zone_0 }
368       flavor: { get_param: flavor_vsrxfw_name }
369       scheduler_hints: { group: { get_resource: vSRXFW_Affinity } }
370       networks:
371       - port: { get_resource: port_vsrx_fw_1_oam_mgmt }
372       - port: { get_resource: port_vsrx_fw_1_dummi }
373       - port: { get_resource: port_vsrx_fw_1_GN }
374       - port: { get_resource: port_vsrx_fw_1_HSL }
375
376       metadata:
377         vnf_id: { get_param: vnf_id }
378
379   port_vsrx_fw_1_oam_mgmt:
380     type: OS::Neutron::Port
381     properties:
382       network: { get_param: oam_mgmt_net_0_id }
383       security_groups: [{get_resource: segw_security_group}]
384
385   port_vsrx_fw_1_dummi:
386     type: OS::Neutron::Port
387     properties:
388       network: { get_resource: Dummi1_net }
389       security_groups: [{get_resource: segw_security_group}]
390
391   port_vsrx_fw_1_GN:
392     type: OS::Neutron::Port
393     properties:
394       network: { get_param: GN_direct_net_1_id }
395 #      fixed_ips: [{"ip_address": {get_param: vsrx_fw_1_GN_direct_ip}}]
396       security_groups: [{get_resource: segw_security_group}]
397
398   port_vsrx_fw_1_HSL:
399     type: OS::Neutron::Port
400     properties:
401       network: { get_resource: hsl_direct_net }
402       security_groups: [{get_resource: segw_security_group}]
403
404   server_vsrx_fw_2:
405     type: OS::Nova::Server
406     properties:
407       name: { get_param: vsrx_fw_2_name }
408       image: { get_param: image_vsrxfw_name }
409       availability_zone: { get_param: availability_zone_0 }
410       flavor: { get_param: flavor_vsrxfw_name }
411       scheduler_hints: { group: { get_resource: vSRXFW_Affinity } }
412       networks:
413       - port: { get_resource: port_vsrx_fw_2_oam_mgmt }
414       - port: { get_resource: port_vsrx_fw_2_dummi }
415       - port: { get_resource: port_vsrx_fw_2_OAM }
416       - port: { get_resource: port_vsrx_fw_2_HSL }
417
418       metadata:
419         vnf_id: { get_param: vnf_id }
420
421   port_vsrx_fw_2_oam_mgmt:
422     type: OS::Neutron::Port
423     properties:
424       network: { get_param: oam_mgmt_net_0_id }
425       security_groups: [{get_resource: segw_security_group}]
426
427   port_vsrx_fw_2_dummi:
428     type: OS::Neutron::Port
429     properties:
430       network: { get_resource: Dummi0_net }
431       security_groups: [{get_resource: segw_security_group}]
432
433   port_vsrx_fw_2_OAM:
434     type: OS::Neutron::Port
435     properties:
436       network: { get_param: Mobility_OAM_protected_net_0_id }
437 #      fixed_ips: [{"ip_address": {get_param: vsrx_fw_2_OAM_protected_ip}}]
438       security_groups: [{get_resource: segw_security_group}]
439
440   port_vsrx_fw_2_HSL:
441     type: OS::Neutron::Port
442     properties:
443       network: { get_resource: hsl_direct_net }
444       security_groups: [{get_resource: segw_security_group}]
445
446   server_vsrx_fw_3:
447     type: OS::Nova::Server
448     properties:
449       name: { get_param: vsrx_fw_3_name }
450       image: { get_param: image_vsrxfw_name }
451       availability_zone: { get_param: availability_zone_0 }
452       flavor: { get_param: flavor_vsrxfw_name }
453       scheduler_hints: { group: { get_resource: vSRXFW_Affinity } }
454       networks:
455       - port: { get_resource: port_vsrx_fw_3_oam_mgmt }
456       - port: { get_resource: port_vsrx_fw_3_dummi }
457       - port: { get_resource: port_vsrx_fw_3_OAM }
458       - port: { get_resource: port_vsrx_fw_3_HSL }
459
460       metadata:
461         vnf_id: { get_param: vnf_id }
462
463   port_vsrx_fw_3_oam_mgmt:
464     type: OS::Neutron::Port
465     properties:
466       network: { get_param: oam_mgmt_net_0_id }
467       security_groups: [{get_resource: segw_security_group}]
468
469   port_vsrx_fw_3_dummi:
470     type: OS::Neutron::Port
471     properties:
472       network: { get_resource: Dummi1_net }
473       security_groups: [{get_resource: segw_security_group}]
474
475   port_vsrx_fw_3_OAM:
476     type: OS::Neutron::Port
477     properties:
478       network: { get_param: Mobility_OAM_protected_net_1_id }
479 #      fixed_ips: [{"ip_address": {get_param: vsrx_fw_3_OAM_protected_ip}}]
480       security_groups: [{get_resource: segw_security_group}]
481
482   port_vsrx_fw_3_HSL:
483     type: OS::Neutron::Port
484     properties:
485       network: { get_resource: hsl_direct_net }
486       security_groups: [{get_resource: segw_security_group}]
487
488 conditions:
489   cd1: True
490   cd2:
491     get_param: param1
492   cd3:
493     equals:
494     - get_param: param2
495     - yes
496   cd4:
497     not:
498       equals:
499       - get_param: param3
500       - yes
501   cd5:
502     and:
503     - equals:
504       - get_param: env_type
505       - prod
506     - not:
507         equals:
508         - get_param: zone
509         - beijing
510   cd6:
511     or:
512     - equals:
513       - get_param: zone
514       - shanghai
515     - equals:
516       - get_param: zone
517       - beijing
518   cd7:
519     not: cd4
520   cd8:
521     and:
522     - cd1
523     - cd2
524   create_prod_res: {equals : [{get_param: env_type}, "prod"]}