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
43 description: Type of instance (flavor) to be used
46 label: Image name or ID
47 description: Image to be used for compute instance
51 description: Type of instance (flavor) to be used
54 label: Image name or ID
55 description: Image to be used for compute instance
59 description: Type of instance (flavor) to be used
62 label: Public network name or ID
63 description: Public network that enables remote connection to VNF
64 unprotected_private_net_id:
66 label: Unprotected private network name or ID
67 description: Private network that connects vPacketGenerator with vFirewall
68 protected_private_net_id:
70 label: Protected private network name or ID
71 description: Private network that connects vFirewall with vSink
74 label: ONAP management network name or ID
75 description: Private network that connects ONAP components and the VNF
76 onap_private_subnet_id:
78 label: ONAP management sub-network name or ID
79 description: Private sub-network that connects ONAP components and the VNF
80 unprotected_private_net_cidr:
82 label: Unprotected private network CIDR
83 description: The CIDR of the unprotected private network
84 protected_private_net_cidr:
86 label: Protected private network CIDR
87 description: The CIDR of the protected private network
88 onap_private_net_cidr:
90 label: ONAP private network CIDR
91 description: The CIDR of the protected private network
92 vfw_int_unprotected_private_ip_0:
94 label: vFirewall private IP address towards the unprotected network
95 description: Private IP address that is assigned to the vFirewall to communicate with the vPacketGenerator
96 vfw_int_protected_private_ip_0:
98 label: vFirewall private IP address towards the protected network
99 description: Private IP address that is assigned to the vFirewall to communicate with the vSink
100 vfw_onap_private_ip_0:
102 label: vFirewall private IP address towards the ONAP management network
103 description: Private IP address that is assigned to the vFirewall to communicate with ONAP components
104 vfw_int_protected_private_floating_ip:
106 label: same value as vpg_int_unprotected_private_ip_0
107 description: IP to inform OpenStack to enable vfw protected private port to allow packets coming from the packet generator
108 vpg_int_unprotected_private_ip_0:
110 label: vPacketGenerator private IP address towards the unprotected network
111 description: Private IP address that is assigned to the vPacketGenerator to communicate with the vFirewall
112 vpg_onap_private_ip_0:
114 label: vPacketGenerator private IP address towards the ONAP management network
115 description: Private IP address that is assigned to the vPacketGenerator to communicate with ONAP components
116 vsn_int_protected_private_ip_0:
118 label: vSink private IP address towards the protected network
119 description: Private IP address that is assigned to the vSink to communicate with the vFirewall
120 vsn_onap_private_ip_0:
122 label: vSink private IP address towards the ONAP management network
123 description: Private IP address that is assigned to the vSink to communicate with ONAP components
126 label: vFirewall name
127 description: Name of the vFirewall
130 label: vPacketGenerator name
131 description: Name of the vPacketGenerator
135 description: Name of the vSink
139 description: The VNF ID is provided by ONAP
143 description: The VNF NAME is provided by ONAP
146 label: vFirewall module ID
147 description: The vFirewall Module ID is provided by ONAP
150 label: DCAE collector IP address
151 description: IP address of the DCAE collector
154 label: DCAE collector port
155 description: Port of the DCAE collector
159 description: Public/Private key pair name
163 description: Public key to be installed on the compute instance
164 install_script_version:
166 label: Installation script version number
167 description: Version number of the scripts that install the vFW demo app
168 demo_artifacts_version:
170 label: Artifacts version used in demo vnfs
171 description: Artifacts (jar, tar.gz) version used in demo vnfs
174 description: Root URL for the Nexus repository for Maven artifacts.
177 label: Cloud environment
178 description: Cloud environment (e.g., openstack, rackspace)
181 description: ONAP Security Group
191 type: OS::Heat::RandomString
196 type: OS::Nova::KeyPair
200 template: vnfname_base_rand
202 base: { get_param: key_name }
203 rand: { get_resource: random-str }
204 vnfname: { get_param: vnf_name }
205 public_key: { get_param: pub_key }
206 save_private_key: false
208 # NETWORK_ROLE: unprotected_private
209 # NETWORK_TYPE: internal
210 int_unprotected_private_network:
211 type: OS::Neutron::Net
215 template: vnfname_netid
217 netid: { get_param: unprotected_private_net_id }
218 vnfname: { get_param: vnf_name }
220 # NETWORK_ROLE: protected_private
221 # NETWORK_TYPE: internal
222 int_protected_private_network:
223 type: OS::Neutron::Net
227 template: vnfname_netid
229 netid: { get_param: protected_private_net_id }
230 vnfname: { get_param: vnf_name }
232 # NETWORK_ROLE: unprotected_private
233 # NETWORK_TYPE: internal
234 int_unprotected_private_subnet:
235 type: OS::Neutron::Subnet
237 network: { get_resource: int_unprotected_private_network }
238 cidr: { get_param: unprotected_private_net_cidr }
240 # NETWORK_ROLE: protected_private
241 # NETWORK_TYPE: internal
242 int_protected_private_subnet:
243 type: OS::Neutron::Subnet
245 network: { get_resource: int_protected_private_network }
246 cidr: { get_param: protected_private_net_cidr }
248 ### Virtual Firewall instantiation ###
251 # NETWORK_ROLE: protected_private
252 # NETWORK_TYPE: internal
253 vfw_0_int_unprotected_private_port_0:
254 type: OS::Neutron::Port
256 network: { get_resource: int_unprotected_private_network }
257 fixed_ips: [{"subnet": { get_resource: int_unprotected_private_subnet }, "ip_address": { get_param: vfw_int_unprotected_private_ip_0 }}]
259 - { get_param: sec_group }
262 # NETWORK_ROLE: protected_private
263 # NETWORK_TYPE: internal
264 vfw_0_int_protected_private_port_0:
265 type: OS::Neutron::Port
267 allowed_address_pairs: [{ "ip_address": { get_param: vfw_int_protected_private_floating_ip }}]
268 network: { get_resource: int_protected_private_network }
269 fixed_ips: [{"subnet": { get_resource: int_protected_private_subnet }, "ip_address": { get_param: vfw_int_protected_private_ip_0 }}]
271 - { get_param: sec_group }
274 # NETWORK_ROLE: onap_private
275 # NETWORK_TYPE: external
276 vfw_0_onap_private_port_0:
277 type: OS::Neutron::Port
279 network: { get_param: onap_private_net_id }
280 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_onap_private_ip_0 }}]
282 - { get_param: sec_group }
286 type: OS::Nova::Server
288 image: { get_param: vfw_image_name }
289 flavor: { get_param: vfw_flavor_name }
290 name: { get_param: vfw_name_0 }
291 key_name: { get_resource: my_keypair }
293 - network: { get_param: public_net_id }
294 - port: { get_resource: vfw_0_int_unprotected_private_port_0 }
295 - port: { get_resource: vfw_0_int_protected_private_port_0 }
296 - port: { get_resource: vfw_0_onap_private_port_0 }
298 vnf_id: { get_param: vnf_id }
299 vf_module_id: { get_param: vf_module_id }
300 vnf_name: { get_param: vnf_name }
301 user_data_format: RAW
305 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
306 __dcae_collector_port__ : { get_param: dcae_collector_port }
307 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
308 __install_script_version__ : { get_param: install_script_version }
309 __vfw_private_ip_0__ : { get_param: vfw_int_unprotected_private_ip_0 }
310 __vfw_private_ip_1__ : { get_param: vfw_int_protected_private_ip_0 }
311 __vfw_private_ip_2__ : { get_param: vfw_onap_private_ip_0 }
312 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
313 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
314 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
315 __cloud_env__ : { get_param: cloud_env }
316 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
320 # Create configuration files
322 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
323 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
324 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
325 echo "__install_script_version__" > /opt/config/install_script_version.txt
326 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
327 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
328 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
329 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
330 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
331 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
332 echo "__cloud_env__" > /opt/config/cloud_env.txt
333 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
335 # Download and run install script
337 apt-get -y install unzip
338 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
339 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
340 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_firewall_install.sh
342 chmod +x v_firewall_install.sh
343 ./v_firewall_install.sh
346 ### Virtual Packet Generator instantiation ###
348 vpg_0_int_unprotected_private_port_0:
349 type: OS::Neutron::Port
351 network: { get_resource: int_unprotected_private_network }
352 fixed_ips: [{"subnet": { get_resource: int_unprotected_private_subnet }, "ip_address": { get_param: vpg_int_unprotected_private_ip_0 }}]
354 - { get_param: sec_group }
356 vpg_0_onap_private_port_0:
357 type: OS::Neutron::Port
359 network: { get_param: onap_private_net_id }
360 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_onap_private_ip_0 }}]
362 - { get_param: sec_group }
365 type: OS::Nova::Server
367 image: { get_param: vpg_image_name }
368 flavor: { get_param: vpg_flavor_name }
369 name: { get_param: vpg_name_0 }
370 key_name: { get_resource: my_keypair }
372 - network: { get_param: public_net_id }
373 - port: { get_resource: vpg_0_int_unprotected_private_port_0 }
374 - port: { get_resource: vpg_0_onap_private_port_0 }
376 vnf_id: { get_param: vnf_id }
377 vf_module_id: { get_param: vf_module_id }
378 vnf_name: { get_param: vnf_name }
379 user_data_format: RAW
383 __fw_ipaddr__: { get_param: vfw_int_unprotected_private_ip_0 }
384 __protected_net_cidr__: { get_param: protected_private_net_cidr }
385 __sink_ipaddr__: { get_param: vsn_int_protected_private_ip_0 }
386 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
387 __install_script_version__ : { get_param: install_script_version }
388 __vpg_private_ip_0__ : { get_param: vpg_int_unprotected_private_ip_0 }
389 __vpg_private_ip_1__ : { get_param: vpg_onap_private_ip_0 }
390 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
391 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
392 __cloud_env__ : { get_param: cloud_env }
393 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
397 # Create configuration files
399 echo "__fw_ipaddr__" > /opt/config/fw_ipaddr.txt
400 echo "__protected_net_cidr__" > /opt/config/protected_net_cidr.txt
401 echo "__sink_ipaddr__" > /opt/config/sink_ipaddr.txt
402 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
403 echo "__install_script_version__" > /opt/config/install_script_version.txt
404 echo "__vpg_private_ip_0__" > /opt/config/vpg_private_ip_0.txt
405 echo "__vpg_private_ip_1__" > /opt/config/vpg_private_ip_1.txt
406 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
407 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
408 echo "__cloud_env__" > /opt/config/cloud_env.txt
409 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
411 # Download and run install script
413 apt-get -y install unzip
414 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
415 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
416 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
418 chmod +x v_packetgen_install.sh
419 ./v_packetgen_install.sh
422 ### Virtual Sink instantiation ###
424 vsn_0_int_protected_private_port_0:
425 type: OS::Neutron::Port
427 network: { get_resource: int_protected_private_network }
428 fixed_ips: [{"subnet": { get_resource: int_protected_private_subnet }, "ip_address": { get_param: vsn_int_protected_private_ip_0 }}]
430 - { get_param: sec_group }
432 vsn_0_onap_private_port_0:
433 type: OS::Neutron::Port
435 network: { get_param: onap_private_net_id }
436 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_onap_private_ip_0 }}]
438 - { get_param: sec_group }
441 type: OS::Nova::Server
443 image: { get_param: vsn_image_name }
444 flavor: { get_param: vsn_flavor_name }
445 name: { get_param: vsn_name_0 }
446 key_name: { get_resource: my_keypair }
448 - network: { get_param: public_net_id }
449 - port: { get_resource: vsn_0_int_protected_private_port_0 }
450 - port: { get_resource: vsn_0_onap_private_port_0 }
452 vnf_id: { get_param: vnf_id }
453 vf_module_id: { get_param: vf_module_id }
454 vnf_name: { get_param: vnf_name }
455 user_data_format: RAW
459 __protected_net_gw__: { get_param: vfw_int_protected_private_ip_0 }
460 __unprotected_net__: { get_param: unprotected_private_net_cidr }
461 __install_script_version__ : { get_param: install_script_version }
462 __vsn_private_ip_0__ : { get_param: vsn_int_protected_private_ip_0 }
463 __vsn_private_ip_1__ : { get_param: vsn_onap_private_ip_0 }
464 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
465 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
466 __cloud_env__ : { get_param: cloud_env }
467 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
471 # Create configuration files
473 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
474 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
475 echo "__install_script_version__" > /opt/config/install_script_version.txt
476 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
477 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
478 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
479 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
480 echo "__cloud_env__" > /opt/config/cloud_env.txt
481 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
483 # Download and run install script
485 apt-get -y install unzip
486 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
487 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
488 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_sink_install.sh
490 chmod +x v_sink_install.sh