1 ##########################################################################
3 #==================LICENSE_START==========================================
6 # Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
19 #==================LICENSE_END============================================
21 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 ##########################################################################
25 heat_template_version: 2013-05-23
27 description: Heat template that deploys vFirewall demo app for ONAP
38 label: Image name or ID
39 description: Image to be used for compute instance
42 label: Firewall Flavor
43 description: Type of instance (flavor) to be used for firewall VM
47 description: Type of instance (flavor) to be used for vSink VM
48 packetgen_flavor_name:
51 description: Type of instance (flavor) to be used for packet generator
54 label: Public network name or ID
55 description: Public network that enables remote connection to VNF
56 unprotected_private_net_id:
58 label: Unprotected private network name or ID
59 description: Private network that connects vPacketGenerator with vFirewall
60 protected_private_net_id:
62 label: Protected private network name or ID
63 description: Private network that connects vFirewall with vSink
66 label: ONAP management network name or ID
67 description: Private network that connects ONAP components and the VNF
68 onap_private_subnet_id:
70 label: ONAP management sub-network name or ID
71 description: Private sub-network that connects ONAP components and the VNF
72 unprotected_private_net_cidr:
74 label: Unprotected private network CIDR
75 description: The CIDR of the unprotected private network
76 protected_private_net_cidr:
78 label: Protected private network CIDR
79 description: The CIDR of the protected private network
80 onap_private_net_cidr:
82 label: ONAP private network CIDR
83 description: The CIDR of the protected private network
86 label: vFirewall private IP address towards the unprotected network
87 description: Private IP address that is assigned to the vFirewall to communicate with the vPacketGenerator
90 label: vFirewall private IP address towards the protected network
91 description: Private IP address that is assigned to the vFirewall to communicate with the vSink
94 label: vFirewall private IP address towards the ONAP management network
95 description: Private IP address that is assigned to the vFirewall to communicate with ONAP components
98 label: vPacketGenerator private IP address towards the unprotected network
99 description: Private IP address that is assigned to the vPacketGenerator to communicate with the vFirewall
102 label: vPacketGenerator private IP address towards the ONAP management network
103 description: Private IP address that is assigned to the vPacketGenerator to communicate with ONAP components
106 label: vSink private IP address towards the protected network
107 description: Private IP address that is assigned to the vSink to communicate with the vFirewall
110 label: vSink private IP address towards the ONAP management network
111 description: Private IP address that is assigned to the vSink to communicate with ONAP components
112 vfw_private_0_port_vnic_type:
114 description: vfw port 0 vnic type (normal, direct)
116 vfw_private_1_port_vnic_type:
118 description: vfw port 1 vnic type (normal, direct)
120 vfw_private_2_port_vnic_type:
122 description: vfw port 2 vnic type (normal, direct)
124 vsn_private_0_port_vnic_type:
126 description: vsn port 0 vnic type (normal, direct)
128 vsn_private_1_port_vnic_type:
130 description: vsn port 1 vnic type (normal, direct)
132 vpg_private_0_port_vnic_type:
134 description: vpg port 0 vnic type (normal, direct)
136 vpg_private_1_port_vnic_type:
138 description: vpg port 1 vnic type (normal, direct)
142 label: vFirewall name
143 description: Name of the vFirewall
146 label: vPacketGenerator name
147 description: Name of the vPacketGenerator
151 description: Name of the vSink
155 description: The VNF ID is provided by ONAP
158 label: vFirewall module ID
159 description: The vFirewall Module ID is provided by ONAP
162 label: DCAE collector IP address
163 description: IP address of the DCAE collector
166 label: DCAE collector port
167 description: Port of the DCAE collector
171 description: Public/Private key pair name
175 description: Public key to be installed on the compute instance
176 install_script_version:
178 label: Installation script version number
179 description: Version number of the scripts that install the vFW demo app
180 demo_artifacts_version:
182 label: Artifacts version used in demo vnfs
183 description: Artifacts (jar, tar.gz) version used in demo vnfs
186 description: Root URL for the Nexus repository for Maven artifacts.
187 default: "https://nexus.onap.org"
190 label: Cloud environment
191 description: Cloud environment (e.g., openstack, rackspace)
194 description: ONAP Security Group
197 description: SDNC Model Name metatada
200 description: SDNC Model Version metatada
203 description: SDNC Artifact Name metatada
213 type: OS::Heat::RandomString
218 type: OS::Nova::KeyPair
224 base: { get_param: key_name }
225 rand: { get_resource: random-str }
226 public_key: { get_param: pub_key }
227 save_private_key: false
229 unprotected_private_network:
230 type: OS::Neutron::Net
232 name: { get_param: unprotected_private_net_id }
234 protected_private_network:
235 type: OS::Neutron::Net
237 name: { get_param: protected_private_net_id }
239 unprotected_private_subnet:
240 type: OS::Neutron::Subnet
242 network_id: { get_resource: unprotected_private_network }
243 cidr: { get_param: unprotected_private_net_cidr }
245 protected_private_subnet:
246 type: OS::Neutron::Subnet
248 network_id: { get_resource: protected_private_network }
249 cidr: { get_param: protected_private_net_cidr }
251 # Virtual Firewall instantiation
253 type: OS::Neutron::Port
255 network: { get_resource: unprotected_private_network }
256 binding:vnic_type: { get_param: vfw_private_0_port_vnic_type}
257 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}]
259 - { get_param: sec_group }
262 type: OS::Neutron::Port
264 allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}]
265 network: { get_resource: protected_private_network }
266 binding:vnic_type: { get_param: vfw_private_1_port_vnic_type}
267 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}]
269 - { get_param: sec_group }
272 type: OS::Neutron::Port
274 network: { get_param: onap_private_net_id }
275 binding:vnic_type: { get_param: vfw_private_2_port_vnic_type}
276 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}]
278 - { get_param: sec_group }
281 type: OS::Nova::Server
283 image: { get_param: vfw_image_name }
284 flavor: { get_param: firewall_flavor_name }
285 name: { get_param: vfw_name_0 }
286 key_name: { get_resource: my_keypair }
288 - network: { get_param: public_net_id }
289 - port: { get_resource: vfw_private_0_port }
290 - port: { get_resource: vfw_private_1_port }
291 - port: { get_resource: vfw_private_2_port }
292 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
293 user_data_format: RAW
297 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
298 __dcae_collector_port__ : { get_param: dcae_collector_port }
299 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
300 __install_script_version__ : { get_param: install_script_version }
301 __vfw_private_ip_0__ : { get_param: vfw_private_ip_0 }
302 __vfw_private_ip_1__ : { get_param: vfw_private_ip_1 }
303 __vfw_private_ip_2__ : { get_param: vfw_private_ip_2 }
304 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
305 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
306 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
307 __cloud_env__ : { get_param: cloud_env }
308 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
312 # Create configuration files
314 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
315 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
316 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
317 echo "__install_script_version__" > /opt/config/install_script_version.txt
318 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
319 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
320 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
321 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
322 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
323 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
324 echo "__cloud_env__" > /opt/config/cloud_env.txt
325 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
327 # Download and run install script
329 apt-get -y install unzip
330 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
331 curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vfw&a=vfw-scripts&e=zip&v=__install_script_version__" -o /opt/vfw-scripts-__install_script_version__.zip
332 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_firewall_install.sh
334 chmod +x v_firewall_install.sh
335 ./v_firewall_install.sh
338 # Virtual Packet Generator instantiation
340 type: OS::Neutron::Port
342 network: { get_resource: unprotected_private_network }
343 binding:vnic_type: { get_param: vpg_private_0_port_vnic_type}
344 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}]
346 - { get_param: sec_group }
349 type: OS::Neutron::Port
351 network: { get_param: onap_private_net_id }
352 binding:vnic_type: { get_param: vpg_private_1_port_vnic_type}
353 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}]
355 - { get_param: sec_group }
358 type: OS::Nova::Server
360 image: { get_param: vfw_image_name }
361 flavor: { get_param: packetgen_flavor_name }
362 name: { get_param: vpg_name_0 }
363 key_name: { get_resource: my_keypair }
365 - network: { get_param: public_net_id }
366 - port: { get_resource: vpg_private_0_port }
367 - port: { get_resource: vpg_private_1_port }
368 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
369 user_data_format: RAW
373 __fw_ipaddr__: { get_param: vfw_private_ip_0 }
374 __protected_net_cidr__: { get_param: protected_private_net_cidr }
375 __sink_ipaddr__: { get_param: vsn_private_ip_0 }
376 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
377 __install_script_version__ : { get_param: install_script_version }
378 __vpg_private_ip_0__ : { get_param: vpg_private_ip_0 }
379 __vpg_private_ip_1__ : { get_param: vpg_private_ip_1 }
380 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
381 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
382 __cloud_env__ : { get_param: cloud_env }
383 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
387 # Create configuration files
389 echo "__fw_ipaddr__" > /opt/config/fw_ipaddr.txt
390 echo "__protected_net_cidr__" > /opt/config/protected_net_cidr.txt
391 echo "__sink_ipaddr__" > /opt/config/sink_ipaddr.txt
392 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
393 echo "__install_script_version__" > /opt/config/install_script_version.txt
394 echo "__vpg_private_ip_0__" > /opt/config/vpg_private_ip_0.txt
395 echo "__vpg_private_ip_1__" > /opt/config/vpg_private_ip_1.txt
396 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
397 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
398 echo "__cloud_env__" > /opt/config/cloud_env.txt
399 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
401 # Download and run install script
403 apt-get -y install unzip
404 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
405 curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vfw&a=vfw-scripts&e=zip&v=__install_script_version__" -o /opt/vfw-scripts-__install_script_version__.zip
406 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
408 chmod +x v_packetgen_install.sh
409 ./v_packetgen_install.sh
412 # Virtual Sink instantiation
414 type: OS::Neutron::Port
416 network: { get_resource: protected_private_network }
417 binding:vnic_type: { get_param: vsn_private_0_port_vnic_type}
418 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}]
420 - { get_param: sec_group }
423 type: OS::Neutron::Port
425 network: { get_param: onap_private_net_id }
426 binding:vnic_type: { get_param: vsn_private_1_port_vnic_type}
427 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}]
429 - { get_param: sec_group }
432 type: OS::Nova::Server
434 image: { get_param: vfw_image_name }
435 flavor: { get_param: sink_flavor_name }
436 name: { get_param: vsn_name_0 }
437 key_name: { get_resource: my_keypair }
439 - network: { get_param: public_net_id }
440 - port: { get_resource: vsn_private_0_port }
441 - port: { get_resource: vsn_private_1_port }
442 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
443 user_data_format: RAW
447 __protected_net_gw__: { get_param: vfw_private_ip_1 }
448 __unprotected_net__: { get_param: unprotected_private_net_cidr }
449 __install_script_version__ : { get_param: install_script_version }
450 __vsn_private_ip_0__ : { get_param: vsn_private_ip_0 }
451 __vsn_private_ip_1__ : { get_param: vsn_private_ip_1 }
452 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
453 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
454 __cloud_env__ : { get_param: cloud_env }
455 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
459 # Create configuration files
461 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
462 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
463 echo "__install_script_version__" > /opt/config/install_script_version.txt
464 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
465 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
466 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
467 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
468 echo "__cloud_env__" > /opt/config/cloud_env.txt
469 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
471 # Download and run install script
473 apt-get -y install unzip
474 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
475 curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vfw&a=vfw-scripts&e=zip&v=__install_script_version__" -o /opt/vfw-scripts-__install_script_version__.zip
476 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_sink_install.sh
478 chmod +x v_sink_install.sh