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 with HPA 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
64 protected_private_provider_net:
66 label: name of provider network to be used to create protected_private_net
67 description: provider net for private network that connects vFirewall with vSink
68 unprotected_private_provider_net:
70 label: name of provider network to be used to create unprotected_private_net
71 description: provider net for private network that connects vPacketGenerator with vFirewall
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
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
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
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
106 label: vPacketGenerator private IP address towards the unprotected network
107 description: Private IP address that is assigned to the vPacketGenerator to communicate with the vFirewall
110 label: vPacketGenerator private IP address towards the ONAP management network
111 description: Private IP address that is assigned to the vPacketGenerator to communicate with ONAP components
114 label: vSink private IP address towards the protected network
115 description: Private IP address that is assigned to the vSink to communicate with the vFirewall
118 label: vSink private IP address towards the ONAP management network
119 description: Private IP address that is assigned to the vSink to communicate with ONAP components
120 vfw_private_0_port_vnic_type:
122 description: vfw port 0 vnic type (normal, direct)
124 vfw_private_1_port_vnic_type:
126 description: vfw port 1 vnic type (normal, direct)
128 vfw_private_2_port_vnic_type:
130 description: vfw port 2 vnic type (normal, direct)
132 vsn_private_0_port_vnic_type:
134 description: vsn port 0 vnic type (normal, direct)
136 vsn_private_1_port_vnic_type:
138 description: vsn port 1 vnic type (normal, direct)
140 vpg_private_0_port_vnic_type:
142 description: vpg port 0 vnic type (normal, direct)
144 vpg_private_1_port_vnic_type:
146 description: vpg port 1 vnic type (normal, direct)
150 label: vFirewall name
151 description: Name of the vFirewall
154 label: vPacketGenerator name
155 description: Name of the vPacketGenerator
159 description: Name of the vSink
163 description: The VNF ID is provided by ONAP
166 label: vFirewall module ID
167 description: The vFirewall Module ID is provided by ONAP
170 label: DCAE collector IP address
171 description: IP address of the DCAE collector
174 label: DCAE collector port
175 description: Port of the DCAE collector
179 description: Public/Private key pair name
183 description: Public key to be installed on the compute instance
184 install_script_version:
186 label: Installation script version number
187 description: Version number of the scripts that install the vFW demo app
188 demo_artifacts_version:
190 label: Artifacts version used in demo vnfs
191 description: Artifacts (jar, tar.gz) version used in demo vnfs
194 description: Root URL for the Nexus repository for Maven artifacts.
195 default: "https://nexus.onap.org"
198 label: Cloud environment
199 description: Cloud environment (e.g., openstack, rackspace)
202 description: ONAP Security Group
212 type: OS::Heat::RandomString
217 type: OS::Nova::KeyPair
223 base: { get_param: key_name }
224 rand: { get_resource: random-str }
225 public_key: { get_param: pub_key }
226 save_private_key: false
228 unprotected_private_network:
229 type: OS::Neutron::ProviderNet
231 name: { get_param: unprotected_private_net_id }
232 physical_network: {get_param: unprotected_private_provider_net}
235 protected_private_network:
236 type: OS::Neutron::ProviderNet
238 name: { get_param: protected_private_net_id }
239 physical_network: {get_param: protected_private_provider_net}
242 unprotected_private_subnet:
243 type: OS::Neutron::Subnet
245 network_id: { get_resource: unprotected_private_network }
246 cidr: { get_param: unprotected_private_net_cidr }
248 protected_private_subnet:
249 type: OS::Neutron::Subnet
251 network_id: { get_resource: protected_private_network }
252 cidr: { get_param: protected_private_net_cidr }
254 # Virtual Firewall instantiation
256 type: OS::Neutron::Port
258 network: { get_resource: unprotected_private_network }
259 binding:vnic_type: { get_param: vfw_private_0_port_vnic_type}
260 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}]
262 - { get_param: sec_group }
265 type: OS::Neutron::Port
267 allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}]
268 network: { get_resource: protected_private_network }
269 binding:vnic_type: { get_param: vfw_private_1_port_vnic_type}
270 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}]
272 - { get_param: sec_group }
275 type: OS::Neutron::Port
277 network: { get_param: onap_private_net_id }
278 binding:vnic_type: { get_param: vfw_private_2_port_vnic_type}
279 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}]
281 - { get_param: sec_group }
284 type: OS::Nova::Server
286 image: { get_param: vfw_image_name }
287 flavor: { get_param: firewall_flavor_name }
288 name: { get_param: vfw_name_0 }
289 key_name: { get_resource: my_keypair }
291 - network: { get_param: public_net_id }
292 - port: { get_resource: vfw_private_0_port }
293 - port: { get_resource: vfw_private_1_port }
294 - port: { get_resource: vfw_private_2_port }
295 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
296 user_data_format: RAW
300 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
301 __dcae_collector_port__ : { get_param: dcae_collector_port }
302 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
303 __install_script_version__ : { get_param: install_script_version }
304 __vfw_private_ip_0__ : { get_param: vfw_private_ip_0 }
305 __vfw_private_ip_1__ : { get_param: vfw_private_ip_1 }
306 __vfw_private_ip_2__ : { get_param: vfw_private_ip_2 }
307 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
308 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
309 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
310 __cloud_env__ : { get_param: cloud_env }
311 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
315 # Create configuration files
317 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
318 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
319 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
320 echo "__install_script_version__" > /opt/config/install_script_version.txt
321 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
322 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
323 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
324 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
325 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
326 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
327 echo "__cloud_env__" > /opt/config/cloud_env.txt
328 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
330 # Download and run install script
332 apt-get -y install unzip
333 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
334 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
335 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_firewall_install.sh
337 chmod +x v_firewall_install.sh
338 ./v_firewall_install.sh
341 # Virtual Packet Generator instantiation
343 type: OS::Neutron::Port
345 network: { get_resource: unprotected_private_network }
346 binding:vnic_type: { get_param: vpg_private_0_port_vnic_type}
347 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}]
349 - { get_param: sec_group }
352 type: OS::Neutron::Port
354 network: { get_param: onap_private_net_id }
355 binding:vnic_type: { get_param: vpg_private_1_port_vnic_type}
356 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}]
358 - { get_param: sec_group }
361 type: OS::Nova::Server
363 image: { get_param: vfw_image_name }
364 flavor: { get_param: packetgen_flavor_name }
365 name: { get_param: vpg_name_0 }
366 key_name: { get_resource: my_keypair }
368 - network: { get_param: public_net_id }
369 - port: { get_resource: vpg_private_0_port }
370 - port: { get_resource: vpg_private_1_port }
371 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
372 user_data_format: RAW
376 __fw_ipaddr__: { get_param: vfw_private_ip_0 }
377 __protected_net_cidr__: { get_param: protected_private_net_cidr }
378 __sink_ipaddr__: { get_param: vsn_private_ip_0 }
379 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
380 __install_script_version__ : { get_param: install_script_version }
381 __vpg_private_ip_0__ : { get_param: vpg_private_ip_0 }
382 __vpg_private_ip_1__ : { get_param: vpg_private_ip_1 }
383 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
384 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
385 __cloud_env__ : { get_param: cloud_env }
386 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
390 # Create configuration files
392 echo "__fw_ipaddr__" > /opt/config/fw_ipaddr.txt
393 echo "__protected_net_cidr__" > /opt/config/protected_net_cidr.txt
394 echo "__sink_ipaddr__" > /opt/config/sink_ipaddr.txt
395 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
396 echo "__install_script_version__" > /opt/config/install_script_version.txt
397 echo "__vpg_private_ip_0__" > /opt/config/vpg_private_ip_0.txt
398 echo "__vpg_private_ip_1__" > /opt/config/vpg_private_ip_1.txt
399 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
400 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
401 echo "__cloud_env__" > /opt/config/cloud_env.txt
402 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
404 # Download and run install script
406 apt-get -y install unzip
407 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
408 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
409 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
411 chmod +x v_packetgen_install.sh
412 ./v_packetgen_install.sh
415 # Virtual Sink instantiation
417 type: OS::Neutron::Port
419 network: { get_resource: protected_private_network }
420 binding:vnic_type: { get_param: vsn_private_0_port_vnic_type}
421 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}]
423 - { get_param: sec_group }
426 type: OS::Neutron::Port
428 network: { get_param: onap_private_net_id }
429 binding:vnic_type: { get_param: vsn_private_1_port_vnic_type}
430 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}]
432 - { get_param: sec_group }
435 type: OS::Nova::Server
437 image: { get_param: vfw_image_name }
438 flavor: { get_param: sink_flavor_name }
439 name: { get_param: vsn_name_0 }
440 key_name: { get_resource: my_keypair }
442 - network: { get_param: public_net_id }
443 - port: { get_resource: vsn_private_0_port }
444 - port: { get_resource: vsn_private_1_port }
445 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
446 user_data_format: RAW
450 __protected_net_gw__: { get_param: vfw_private_ip_1 }
451 __unprotected_net__: { get_param: unprotected_private_net_cidr }
452 __install_script_version__ : { get_param: install_script_version }
453 __vsn_private_ip_0__ : { get_param: vsn_private_ip_0 }
454 __vsn_private_ip_1__ : { get_param: vsn_private_ip_1 }
455 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
456 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
457 __cloud_env__ : { get_param: cloud_env }
458 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
462 # Create configuration files
464 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
465 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
466 echo "__install_script_version__" > /opt/config/install_script_version.txt
467 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
468 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
469 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
470 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
471 echo "__cloud_env__" > /opt/config/cloud_env.txt
472 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
474 # Download and run install script
476 apt-get -y install unzip
477 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
478 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
479 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_sink_install.sh
481 chmod +x v_sink_install.sh