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
161 description: SDNC Model Name metatada
164 description: SDNC Model Version metatada
167 description: SDNC Artifact Name metatada
177 type: OS::Heat::RandomString
182 type: OS::Nova::KeyPair
188 base: { get_param: key_name }
189 rand: { get_resource: random-str }
190 public_key: { get_param: pub_key }
191 save_private_key: false
193 unprotected_private_network:
194 type: OS::Neutron::Net
196 name: { get_param: unprotected_private_net_id }
198 protected_private_network:
199 type: OS::Neutron::Net
201 name: { get_param: protected_private_net_id }
203 unprotected_private_subnet:
204 type: OS::Neutron::Subnet
206 network_id: { get_resource: unprotected_private_network }
207 cidr: { get_param: unprotected_private_net_cidr }
209 protected_private_subnet:
210 type: OS::Neutron::Subnet
212 network_id: { get_resource: protected_private_network }
213 cidr: { get_param: protected_private_net_cidr }
215 # Virtual Firewall instantiation
217 type: OS::Neutron::Port
219 network: { get_resource: unprotected_private_network }
220 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}]
222 - { get_param: sec_group }
225 type: OS::Neutron::Port
227 allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}]
228 network: { get_resource: protected_private_network }
229 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}]
231 - { get_param: sec_group }
234 type: OS::Neutron::Port
236 network: { get_param: onap_private_net_id }
237 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}]
239 - { get_param: sec_group }
242 type: OS::Nova::Server
244 image: { get_param: vfw_image_name }
245 flavor: { get_param: vfw_flavor_name }
246 name: { get_param: vfw_name_0 }
247 key_name: { get_resource: my_keypair }
249 - network: { get_param: public_net_id }
250 - port: { get_resource: vfw_private_0_port }
251 - port: { get_resource: vfw_private_1_port }
252 - port: { get_resource: vfw_private_2_port }
253 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 }}
254 user_data_format: RAW
258 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
259 __dcae_collector_port__ : { get_param: dcae_collector_port }
260 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
261 __install_script_version__ : { get_param: install_script_version }
262 __vfw_private_ip_0__ : { get_param: vfw_private_ip_0 }
263 __vfw_private_ip_1__ : { get_param: vfw_private_ip_1 }
264 __vfw_private_ip_2__ : { get_param: vfw_private_ip_2 }
265 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
266 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
267 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
268 __cloud_env__ : { get_param: cloud_env }
269 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
273 # Create configuration files
275 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
276 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
277 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
278 echo "__install_script_version__" > /opt/config/install_script_version.txt
279 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
280 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
281 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
282 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
283 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
284 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
285 echo "__cloud_env__" > /opt/config/cloud_env.txt
286 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
288 # Download and run install script
289 apt-get -y install unzip
290 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
291 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
292 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_firewall_install.sh
294 chmod +x v_firewall_install.sh
295 ./v_firewall_install.sh
298 # Virtual Packet Generator instantiation
300 type: OS::Neutron::Port
302 network: { get_resource: unprotected_private_network }
303 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}]
305 - { get_param: sec_group }
308 type: OS::Neutron::Port
310 network: { get_param: onap_private_net_id }
311 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}]
313 - { get_param: sec_group }
316 type: OS::Nova::Server
318 image: { get_param: vfw_image_name }
319 flavor: { get_param: vfw_flavor_name }
320 name: { get_param: vpg_name_0 }
321 key_name: { get_resource: my_keypair }
323 - network: { get_param: public_net_id }
324 - port: { get_resource: vpg_private_0_port }
325 - port: { get_resource: vpg_private_1_port }
326 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 }}
327 user_data_format: RAW
331 __fw_ipaddr__: { get_param: vfw_private_ip_0 }
332 __protected_net_cidr__: { get_param: protected_private_net_cidr }
333 __sink_ipaddr__: { get_param: vsn_private_ip_0 }
334 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
335 __install_script_version__ : { get_param: install_script_version }
336 __vpg_private_ip_0__ : { get_param: vpg_private_ip_0 }
337 __vpg_private_ip_1__ : { get_param: vpg_private_ip_1 }
338 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
339 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
340 __cloud_env__ : { get_param: cloud_env }
341 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
345 # Create configuration files
347 echo "__fw_ipaddr__" > /opt/config/fw_ipaddr.txt
348 echo "__protected_net_cidr__" > /opt/config/protected_net_cidr.txt
349 echo "__sink_ipaddr__" > /opt/config/sink_ipaddr.txt
350 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
351 echo "__install_script_version__" > /opt/config/install_script_version.txt
352 echo "__vpg_private_ip_0__" > /opt/config/vpg_private_ip_0.txt
353 echo "__vpg_private_ip_1__" > /opt/config/vpg_private_ip_1.txt
354 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
355 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
356 echo "__cloud_env__" > /opt/config/cloud_env.txt
357 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
359 # Download and run install script
360 apt-get -y install unzip
361 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
362 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
363 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_packetgen_install.sh
365 chmod +x v_packetgen_install.sh
366 ./v_packetgen_install.sh
369 # Virtual Sink instantiation
371 type: OS::Neutron::Port
373 network: { get_resource: protected_private_network }
374 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}]
376 - { get_param: sec_group }
379 type: OS::Neutron::Port
381 network: { get_param: onap_private_net_id }
382 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}]
384 - { get_param: sec_group }
387 type: OS::Nova::Server
389 image: { get_param: vfw_image_name }
390 flavor: { get_param: vfw_flavor_name }
391 name: { get_param: vsn_name_0 }
392 key_name: { get_resource: my_keypair }
394 - network: { get_param: public_net_id }
395 - port: { get_resource: vsn_private_0_port }
396 - port: { get_resource: vsn_private_1_port }
397 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 }}
398 user_data_format: RAW
402 __protected_net_gw__: { get_param: vfw_private_ip_1 }
403 __unprotected_net__: { get_param: unprotected_private_net_cidr }
404 __install_script_version__ : { get_param: install_script_version }
405 __vsn_private_ip_0__ : { get_param: vsn_private_ip_0 }
406 __vsn_private_ip_1__ : { get_param: vsn_private_ip_1 }
407 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
408 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
409 __cloud_env__ : { get_param: cloud_env }
410 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
414 # Create configuration files
416 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
417 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
418 echo "__install_script_version__" > /opt/config/install_script_version.txt
419 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
420 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
421 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
422 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
423 echo "__cloud_env__" > /opt/config/cloud_env.txt
424 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
426 # Download and run install script
427 apt-get -y install unzip
428 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
429 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
430 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_sink_install.sh
432 chmod +x v_sink_install.sh