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: Public network name or ID
47 description: Public network that enables remote connection to VNF
48 unprotected_private_net_id:
50 label: Unprotected private network name or ID
51 description: Private network that connects vPacketGenerator with vFirewall
52 protected_private_net_id:
54 label: Protected private network name or ID
55 description: Private network that connects vFirewall with vSink
58 label: ONAP management network name or ID
59 description: Private network that connects ONAP components and the VNF
60 onap_private_subnet_id:
62 label: ONAP management sub-network name or ID
63 description: Private sub-network that connects ONAP components and the VNF
64 unprotected_private_net_cidr:
66 label: Unprotected private network CIDR
67 description: The CIDR of the unprotected private network
68 protected_private_net_cidr:
70 label: Protected private network CIDR
71 description: The CIDR of the protected private network
72 onap_private_net_cidr:
74 label: ONAP private network CIDR
75 description: The CIDR of the protected private network
78 label: vFirewall private IP address towards the unprotected network
79 description: Private IP address that is assigned to the vFirewall to communicate with the vPacketGenerator
82 label: vFirewall private IP address towards the protected network
83 description: Private IP address that is assigned to the vFirewall to communicate with the vSink
86 label: vFirewall private IP address towards the ONAP management network
87 description: Private IP address that is assigned to the vFirewall to communicate with ONAP components
90 label: vPacketGenerator private IP address towards the unprotected network
91 description: Private IP address that is assigned to the vPacketGenerator to communicate with the vFirewall
94 label: vPacketGenerator private IP address towards the ONAP management network
95 description: Private IP address that is assigned to the vPacketGenerator to communicate with ONAP components
98 label: vSink private IP address towards the protected network
99 description: Private IP address that is assigned to the vSink to communicate with the vFirewall
102 label: vSink private IP address towards the ONAP management network
103 description: Private IP address that is assigned to the vSink to communicate with ONAP components
106 label: vFirewall name
107 description: Name of the vFirewall
110 label: vPacketGenerator name
111 description: Name of the vPacketGenerator
115 description: Name of the vSink
119 description: The VNF ID is provided by ONAP
122 label: vFirewall module ID
123 description: The vFirewall Module ID is provided by ONAP
126 label: DCAE collector IP address
127 description: IP address of the DCAE collector
130 label: DCAE collector port
131 description: Port of the DCAE collector
135 description: Public/Private key pair name
139 description: Public key to be installed on the compute instance
140 install_script_version:
142 label: Installation script version number
143 description: Version number of the scripts that install the vFW demo app
144 demo_artifacts_version:
146 label: Artifacts version used in demo vnfs
147 description: Artifacts (jar, tar.gz) version used in demo vnfs
150 description: Root URL for the Nexus repository for Maven artifacts.
151 default: "https://nexus.onap.org"
154 label: Cloud environment
155 description: Cloud environment (e.g., openstack, rackspace)
158 description: ONAP Security Group
168 type: OS::Heat::RandomString
173 type: OS::Nova::KeyPair
179 base: { get_param: key_name }
180 rand: { get_resource: random-str }
181 public_key: { get_param: pub_key }
182 save_private_key: false
184 unprotected_private_network:
185 type: OS::Neutron::Net
187 name: { get_param: unprotected_private_net_id }
189 protected_private_network:
190 type: OS::Neutron::Net
192 name: { get_param: protected_private_net_id }
194 unprotected_private_subnet:
195 type: OS::Neutron::Subnet
197 network_id: { get_resource: unprotected_private_network }
198 cidr: { get_param: unprotected_private_net_cidr }
200 protected_private_subnet:
201 type: OS::Neutron::Subnet
203 network_id: { get_resource: protected_private_network }
204 cidr: { get_param: protected_private_net_cidr }
206 # Virtual Firewall instantiation
208 type: OS::Neutron::Port
210 network: { get_resource: unprotected_private_network }
211 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}]
213 - { get_param: sec_group }
216 type: OS::Neutron::Port
218 allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}]
219 network: { get_resource: protected_private_network }
220 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}]
222 - { get_param: sec_group }
225 type: OS::Neutron::Port
227 network: { get_param: onap_private_net_id }
228 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}]
230 - { get_param: sec_group }
233 type: OS::Nova::Server
235 image: { get_param: vfw_image_name }
236 flavor: { get_param: vfw_flavor_name }
237 name: { get_param: vfw_name_0 }
238 key_name: { get_resource: my_keypair }
240 - network: { get_param: public_net_id }
241 - port: { get_resource: vfw_private_0_port }
242 - port: { get_resource: vfw_private_1_port }
243 - port: { get_resource: vfw_private_2_port }
244 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
245 user_data_format: RAW
249 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
250 __dcae_collector_port__ : { get_param: dcae_collector_port }
251 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
252 __install_script_version__ : { get_param: install_script_version }
253 __vfw_private_ip_0__ : { get_param: vfw_private_ip_0 }
254 __vfw_private_ip_1__ : { get_param: vfw_private_ip_1 }
255 __vfw_private_ip_2__ : { get_param: vfw_private_ip_2 }
256 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
257 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
258 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
259 __cloud_env__ : { get_param: cloud_env }
260 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
264 # Create configuration files
266 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
267 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
268 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
269 echo "__install_script_version__" > /opt/config/install_script_version.txt
270 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
271 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
272 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
273 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
274 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
275 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
276 echo "__cloud_env__" > /opt/config/cloud_env.txt
277 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
279 # Download and run install script
280 apt-get -y install unzip
281 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
282 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
283 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_firewall_install.sh
285 chmod +x v_firewall_install.sh
286 ./v_firewall_install.sh
289 # Virtual Packet Generator instantiation
291 type: OS::Neutron::Port
293 network: { get_resource: unprotected_private_network }
294 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}]
296 - { get_param: sec_group }
299 type: OS::Neutron::Port
301 network: { get_param: onap_private_net_id }
302 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}]
304 - { get_param: sec_group }
307 type: OS::Nova::Server
309 image: { get_param: vfw_image_name }
310 flavor: { get_param: vfw_flavor_name }
311 name: { get_param: vpg_name_0 }
312 key_name: { get_resource: my_keypair }
314 - network: { get_param: public_net_id }
315 - port: { get_resource: vpg_private_0_port }
316 - port: { get_resource: vpg_private_1_port }
317 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
318 user_data_format: RAW
322 __fw_ipaddr__: { get_param: vfw_private_ip_0 }
323 __protected_net_cidr__: { get_param: protected_private_net_cidr }
324 __sink_ipaddr__: { get_param: vsn_private_ip_0 }
325 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
326 __install_script_version__ : { get_param: install_script_version }
327 __vpg_private_ip_0__ : { get_param: vpg_private_ip_0 }
328 __vpg_private_ip_1__ : { get_param: vpg_private_ip_1 }
329 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
330 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
331 __cloud_env__ : { get_param: cloud_env }
332 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
336 # Create configuration files
338 echo "__fw_ipaddr__" > /opt/config/fw_ipaddr.txt
339 echo "__protected_net_cidr__" > /opt/config/protected_net_cidr.txt
340 echo "__sink_ipaddr__" > /opt/config/sink_ipaddr.txt
341 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
342 echo "__install_script_version__" > /opt/config/install_script_version.txt
343 echo "__vpg_private_ip_0__" > /opt/config/vpg_private_ip_0.txt
344 echo "__vpg_private_ip_1__" > /opt/config/vpg_private_ip_1.txt
345 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
346 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
347 echo "__cloud_env__" > /opt/config/cloud_env.txt
348 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
350 # Download and run install script
351 apt-get -y install unzip
352 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
353 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
354 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
356 chmod +x v_packetgen_install.sh
357 ./v_packetgen_install.sh
360 # Virtual Sink instantiation
362 type: OS::Neutron::Port
364 network: { get_resource: protected_private_network }
365 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}]
367 - { get_param: sec_group }
370 type: OS::Neutron::Port
372 network: { get_param: onap_private_net_id }
373 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}]
375 - { get_param: sec_group }
378 type: OS::Nova::Server
380 image: { get_param: vfw_image_name }
381 flavor: { get_param: vfw_flavor_name }
382 name: { get_param: vsn_name_0 }
383 key_name: { get_resource: my_keypair }
385 - network: { get_param: public_net_id }
386 - port: { get_resource: vsn_private_0_port }
387 - port: { get_resource: vsn_private_1_port }
388 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
389 user_data_format: RAW
393 __protected_net_gw__: { get_param: vfw_private_ip_1 }
394 __unprotected_net__: { get_param: unprotected_private_net_cidr }
395 __install_script_version__ : { get_param: install_script_version }
396 __vsn_private_ip_0__ : { get_param: vsn_private_ip_0 }
397 __vsn_private_ip_1__ : { get_param: vsn_private_ip_1 }
398 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
399 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
400 __cloud_env__ : { get_param: cloud_env }
401 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
405 # Create configuration files
407 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
408 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
409 echo "__install_script_version__" > /opt/config/install_script_version.txt
410 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
411 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
412 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
413 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
414 echo "__cloud_env__" > /opt/config/cloud_env.txt
415 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
417 # Download and run install script
418 apt-get -y install unzip
419 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
420 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
421 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_sink_install.sh
423 chmod +x v_sink_install.sh