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)
115 vfw_private_1_port_vnic_type:
117 description: vfw port 1 vnic type (normal, direct)
118 vfw_private_2_port_vnic_type:
120 description: vfw port 2 vnic type (normal, direct)
121 vsn_private_0_port_vnic_type:
123 description: vsn port 0 vnic type (normal, direct)
124 vsn_private_1_port_vnic_type:
126 description: vsn port 1 vnic type (normal, direct)
127 vpg_private_0_port_vnic_type:
129 description: vpg port 0 vnic type (normal, direct)
130 vpg_private_1_port_vnic_type:
132 description: vpg port 1 vnic type (normal, direct)
135 label: vFirewall name
136 description: Name of the vFirewall
139 label: vPacketGenerator name
140 description: Name of the vPacketGenerator
144 description: Name of the vSink
148 description: The VNF ID is provided by ONAP
151 label: vFirewall module ID
152 description: The vFirewall Module ID is provided by ONAP
155 label: DCAE collector IP address
156 description: IP address of the DCAE collector
159 label: DCAE collector port
160 description: Port of the DCAE collector
164 description: Public/Private key pair name
168 description: Public key to be installed on the compute instance
169 install_script_version:
171 label: Installation script version number
172 description: Version number of the scripts that install the vFW demo app
173 demo_artifacts_version:
175 label: Artifacts version used in demo vnfs
176 description: Artifacts (jar, tar.gz) version used in demo vnfs
179 description: Root URL for the Nexus repository for Maven artifacts.
180 default: "https://nexus.onap.org"
183 label: Cloud environment
184 description: Cloud environment (e.g., openstack, rackspace)
187 description: ONAP Security Group
190 description: SDNC Model Name metatada
193 description: SDNC Model Version metatada
196 description: SDNC Artifact Name metatada
206 type: OS::Heat::RandomString
211 type: OS::Nova::KeyPair
217 base: { get_param: key_name }
218 rand: { get_resource: random-str }
219 public_key: { get_param: pub_key }
220 save_private_key: false
222 unprotected_private_network:
223 type: OS::Neutron::Net
225 name: { get_param: unprotected_private_net_id }
227 protected_private_network:
228 type: OS::Neutron::Net
230 name: { get_param: protected_private_net_id }
232 unprotected_private_subnet:
233 type: OS::Neutron::Subnet
235 network_id: { get_resource: unprotected_private_network }
236 cidr: { get_param: unprotected_private_net_cidr }
238 protected_private_subnet:
239 type: OS::Neutron::Subnet
241 network_id: { get_resource: protected_private_network }
242 cidr: { get_param: protected_private_net_cidr }
244 # Virtual Firewall instantiation
246 type: OS::Neutron::Port
248 network: { get_resource: unprotected_private_network }
249 binding:vnic_type: { get_param: vfw_private_0_port_vnic_type}
250 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}]
252 - { get_param: sec_group }
255 type: OS::Neutron::Port
257 allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}]
258 network: { get_resource: protected_private_network }
259 binding:vnic_type: { get_param: vfw_private_1_port_vnic_type}
260 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}]
262 - { get_param: sec_group }
265 type: OS::Neutron::Port
267 network: { get_param: onap_private_net_id }
268 binding:vnic_type: { get_param: vfw_private_2_port_vnic_type}
269 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}]
271 - { get_param: sec_group }
274 type: OS::Nova::Server
276 image: { get_param: vfw_image_name }
277 flavor: { get_param: firewall_flavor_name }
278 name: { get_param: vfw_name_0 }
279 key_name: { get_resource: my_keypair }
281 - network: { get_param: public_net_id }
282 - port: { get_resource: vfw_private_0_port }
283 - port: { get_resource: vfw_private_1_port }
284 - port: { get_resource: vfw_private_2_port }
285 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }, sdnc_model_name: { get_param: sdnc_model_name }, sdnc_model_version: { get_param: sdnc_model_version }, sdnc_artifact_name: { get_param: sdnc_artifact_name }}
286 user_data_format: RAW
290 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
291 __dcae_collector_port__ : { get_param: dcae_collector_port }
292 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
293 __install_script_version__ : { get_param: install_script_version }
294 __vfw_private_ip_0__ : { get_param: vfw_private_ip_0 }
295 __vfw_private_ip_1__ : { get_param: vfw_private_ip_1 }
296 __vfw_private_ip_2__ : { get_param: vfw_private_ip_2 }
297 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
298 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
299 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
300 __cloud_env__ : { get_param: cloud_env }
301 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
305 # Create configuration files
307 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
308 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
309 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
310 echo "__install_script_version__" > /opt/config/install_script_version.txt
311 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
312 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
313 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
314 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
315 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
316 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
317 echo "__cloud_env__" > /opt/config/cloud_env.txt
318 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
320 # Download and run install script
322 apt-get -y install unzip
323 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
324 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
325 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_firewall_install.sh
327 chmod +x v_firewall_install.sh
328 ./v_firewall_install.sh
331 # Virtual Packet Generator instantiation
333 type: OS::Neutron::Port
335 network: { get_resource: unprotected_private_network }
336 binding:vnic_type: { get_param: vpg_private_0_port_vnic_type}
337 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}]
339 - { get_param: sec_group }
342 type: OS::Neutron::Port
344 network: { get_param: onap_private_net_id }
345 binding:vnic_type: { get_param: vpg_private_1_port_vnic_type}
346 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}]
348 - { get_param: sec_group }
351 type: OS::Nova::Server
353 image: { get_param: vfw_image_name }
354 flavor: { get_param: packetgen_flavor_name }
355 name: { get_param: vpg_name_0 }
356 key_name: { get_resource: my_keypair }
358 - network: { get_param: public_net_id }
359 - port: { get_resource: vpg_private_0_port }
360 - port: { get_resource: vpg_private_1_port }
361 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }, sdnc_model_name: { get_param: sdnc_model_name }, sdnc_model_version: { get_param: sdnc_model_version }, sdnc_artifact_name: { get_param: sdnc_artifact_name }}
362 user_data_format: RAW
366 __fw_ipaddr__: { get_param: vfw_private_ip_0 }
367 __protected_net_cidr__: { get_param: protected_private_net_cidr }
368 __sink_ipaddr__: { get_param: vsn_private_ip_0 }
369 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
370 __install_script_version__ : { get_param: install_script_version }
371 __vpg_private_ip_0__ : { get_param: vpg_private_ip_0 }
372 __vpg_private_ip_1__ : { get_param: vpg_private_ip_1 }
373 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
374 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
375 __cloud_env__ : { get_param: cloud_env }
376 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
380 # Create configuration files
382 echo "__fw_ipaddr__" > /opt/config/fw_ipaddr.txt
383 echo "__protected_net_cidr__" > /opt/config/protected_net_cidr.txt
384 echo "__sink_ipaddr__" > /opt/config/sink_ipaddr.txt
385 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
386 echo "__install_script_version__" > /opt/config/install_script_version.txt
387 echo "__vpg_private_ip_0__" > /opt/config/vpg_private_ip_0.txt
388 echo "__vpg_private_ip_1__" > /opt/config/vpg_private_ip_1.txt
389 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
390 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
391 echo "__cloud_env__" > /opt/config/cloud_env.txt
392 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
394 # Download and run install script
396 apt-get -y install unzip
397 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
398 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
399 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
401 chmod +x v_packetgen_install.sh
402 ./v_packetgen_install.sh
405 # Virtual Sink instantiation
407 type: OS::Neutron::Port
409 network: { get_resource: protected_private_network }
410 binding:vnic_type: { get_param: vsn_private_0_port_vnic_type}
411 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}]
413 - { get_param: sec_group }
416 type: OS::Neutron::Port
418 network: { get_param: onap_private_net_id }
419 binding:vnic_type: { get_param: vsn_private_1_port_vnic_type}
420 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}]
422 - { get_param: sec_group }
425 type: OS::Nova::Server
427 image: { get_param: vfw_image_name }
428 flavor: { get_param: sink_flavor_name }
429 name: { get_param: vsn_name_0 }
430 key_name: { get_resource: my_keypair }
432 - network: { get_param: public_net_id }
433 - port: { get_resource: vsn_private_0_port }
434 - port: { get_resource: vsn_private_1_port }
435 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }, sdnc_model_name: { get_param: sdnc_model_name }, sdnc_model_version: { get_param: sdnc_model_version }, sdnc_artifact_name: { get_param: sdnc_artifact_name }}
436 user_data_format: RAW
440 __protected_net_gw__: { get_param: vfw_private_ip_1 }
441 __unprotected_net__: { get_param: unprotected_private_net_cidr }
442 __install_script_version__ : { get_param: install_script_version }
443 __vsn_private_ip_0__ : { get_param: vsn_private_ip_0 }
444 __vsn_private_ip_1__ : { get_param: vsn_private_ip_1 }
445 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
446 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
447 __cloud_env__ : { get_param: cloud_env }
448 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
452 # Create configuration files
454 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
455 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
456 echo "__install_script_version__" > /opt/config/install_script_version.txt
457 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
458 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
459 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
460 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
461 echo "__cloud_env__" > /opt/config/cloud_env.txt
462 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
464 # Download and run install script
466 apt-get -y install unzip
467 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
468 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
469 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_sink_install.sh
471 chmod +x v_sink_install.sh