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
204 type: OS::Heat::RandomString
209 type: OS::Nova::KeyPair
215 base: { get_param: key_name }
216 rand: { get_resource: random-str }
217 public_key: { get_param: pub_key }
218 save_private_key: false
220 unprotected_private_network:
221 type: OS::Neutron::Net
223 name: { get_param: unprotected_private_net_id }
225 protected_private_network:
226 type: OS::Neutron::Net
228 name: { get_param: protected_private_net_id }
230 unprotected_private_subnet:
231 type: OS::Neutron::Subnet
233 network_id: { get_resource: unprotected_private_network }
234 cidr: { get_param: unprotected_private_net_cidr }
236 protected_private_subnet:
237 type: OS::Neutron::Subnet
239 network_id: { get_resource: protected_private_network }
240 cidr: { get_param: protected_private_net_cidr }
242 # Virtual Firewall instantiation
244 type: OS::Neutron::Port
246 network: { get_resource: unprotected_private_network }
247 binding:vnic_type: { get_param: vfw_private_0_port_vnic_type}
248 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}]
250 - { get_param: sec_group }
253 type: OS::Neutron::Port
255 allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}]
256 network: { get_resource: protected_private_network }
257 binding:vnic_type: { get_param: vfw_private_1_port_vnic_type}
258 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}]
260 - { get_param: sec_group }
263 type: OS::Neutron::Port
265 network: { get_param: onap_private_net_id }
266 binding:vnic_type: { get_param: vfw_private_2_port_vnic_type}
267 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}]
269 - { get_param: sec_group }
272 type: OS::Nova::Server
274 image: { get_param: vfw_image_name }
275 flavor: { get_param: firewall_flavor_name }
276 name: { get_param: vfw_name_0 }
277 key_name: { get_resource: my_keypair }
279 - network: { get_param: public_net_id }
280 - port: { get_resource: vfw_private_0_port }
281 - port: { get_resource: vfw_private_1_port }
282 - port: { get_resource: vfw_private_2_port }
283 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
284 user_data_format: RAW
288 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
289 __dcae_collector_port__ : { get_param: dcae_collector_port }
290 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
291 __install_script_version__ : { get_param: install_script_version }
292 __vfw_private_ip_0__ : { get_param: vfw_private_ip_0 }
293 __vfw_private_ip_1__ : { get_param: vfw_private_ip_1 }
294 __vfw_private_ip_2__ : { get_param: vfw_private_ip_2 }
295 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
296 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
297 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
298 __cloud_env__ : { get_param: cloud_env }
299 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
303 # Create configuration files
305 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
306 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
307 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
308 echo "__install_script_version__" > /opt/config/install_script_version.txt
309 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
310 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
311 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
312 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
313 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
314 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
315 echo "__cloud_env__" > /opt/config/cloud_env.txt
316 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
318 # Download and run install script
320 apt-get -y install unzip
321 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
322 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
323 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_firewall_install.sh
325 chmod +x v_firewall_install.sh
326 ./v_firewall_install.sh
329 # Virtual Packet Generator instantiation
331 type: OS::Neutron::Port
333 network: { get_resource: unprotected_private_network }
334 binding:vnic_type: { get_param: vpg_private_0_port_vnic_type}
335 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}]
337 - { get_param: sec_group }
340 type: OS::Neutron::Port
342 network: { get_param: onap_private_net_id }
343 binding:vnic_type: { get_param: vpg_private_1_port_vnic_type}
344 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}]
346 - { get_param: sec_group }
349 type: OS::Nova::Server
351 image: { get_param: vfw_image_name }
352 flavor: { get_param: packetgen_flavor_name }
353 name: { get_param: vpg_name_0 }
354 key_name: { get_resource: my_keypair }
356 - network: { get_param: public_net_id }
357 - port: { get_resource: vpg_private_0_port }
358 - port: { get_resource: vpg_private_1_port }
359 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
360 user_data_format: RAW
364 __fw_ipaddr__: { get_param: vfw_private_ip_0 }
365 __protected_net_cidr__: { get_param: protected_private_net_cidr }
366 __sink_ipaddr__: { get_param: vsn_private_ip_0 }
367 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
368 __install_script_version__ : { get_param: install_script_version }
369 __vpg_private_ip_0__ : { get_param: vpg_private_ip_0 }
370 __vpg_private_ip_1__ : { get_param: vpg_private_ip_1 }
371 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
372 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
373 __cloud_env__ : { get_param: cloud_env }
374 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
378 # Create configuration files
380 echo "__fw_ipaddr__" > /opt/config/fw_ipaddr.txt
381 echo "__protected_net_cidr__" > /opt/config/protected_net_cidr.txt
382 echo "__sink_ipaddr__" > /opt/config/sink_ipaddr.txt
383 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
384 echo "__install_script_version__" > /opt/config/install_script_version.txt
385 echo "__vpg_private_ip_0__" > /opt/config/vpg_private_ip_0.txt
386 echo "__vpg_private_ip_1__" > /opt/config/vpg_private_ip_1.txt
387 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
388 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
389 echo "__cloud_env__" > /opt/config/cloud_env.txt
390 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
392 # Download and run install script
394 apt-get -y install unzip
395 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
396 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
397 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
399 chmod +x v_packetgen_install.sh
400 ./v_packetgen_install.sh
403 # Virtual Sink instantiation
405 type: OS::Neutron::Port
407 network: { get_resource: protected_private_network }
408 binding:vnic_type: { get_param: vsn_private_0_port_vnic_type}
409 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}]
411 - { get_param: sec_group }
414 type: OS::Neutron::Port
416 network: { get_param: onap_private_net_id }
417 binding:vnic_type: { get_param: vsn_private_1_port_vnic_type}
418 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}]
420 - { get_param: sec_group }
423 type: OS::Nova::Server
425 image: { get_param: vfw_image_name }
426 flavor: { get_param: sink_flavor_name }
427 name: { get_param: vsn_name_0 }
428 key_name: { get_resource: my_keypair }
430 - network: { get_param: public_net_id }
431 - port: { get_resource: vsn_private_0_port }
432 - port: { get_resource: vsn_private_1_port }
433 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
434 user_data_format: RAW
438 __protected_net_gw__: { get_param: vfw_private_ip_1 }
439 __unprotected_net__: { get_param: unprotected_private_net_cidr }
440 __install_script_version__ : { get_param: install_script_version }
441 __vsn_private_ip_0__ : { get_param: vsn_private_ip_0 }
442 __vsn_private_ip_1__ : { get_param: vsn_private_ip_1 }
443 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
444 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
445 __cloud_env__ : { get_param: cloud_env }
446 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
450 # Create configuration files
452 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
453 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
454 echo "__install_script_version__" > /opt/config/install_script_version.txt
455 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
456 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
457 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
458 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
459 echo "__cloud_env__" > /opt/config/cloud_env.txt
460 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
462 # Download and run install script
464 apt-get -y install unzip
465 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
466 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
467 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_sink_install.sh
469 chmod +x v_sink_install.sh