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 Closed Loop demo app (vFW and vSink) 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
50 label: Public network name or ID
51 description: Public network that enables remote connection to VNF
52 unprotected_private_net_id:
54 label: Unprotected private network name or ID
55 description: Private network that connects vPacketGenerator with vFirewall
56 unprotected_private_subnet_id:
58 label: Unprotected private subnetwork name or ID
59 description: Private subnetwork of the protected network
60 unprotected_private_net_cidr:
62 label: Unprotected private network CIDR
63 description: The CIDR of the unprotected private network
64 protected_private_net_id:
66 label: Protected private network name or ID
67 description: Private network that connects vFirewall with vSink
68 protected_private_subnet_id:
70 label: Protected private subnetwork name or ID
71 description: Private subnetwork of the unprotected network
72 protected_private_net_cidr:
74 label: Protected private network CIDR
75 description: The CIDR of the protected private network
78 label: ONAP management network name or ID
79 description: Private network that connects ONAP components and the VNF
80 onap_private_subnet_id:
82 label: ONAP management sub-network name or ID
83 description: Private sub-network that connects ONAP components and the VNF
84 onap_private_net_cidr:
86 label: ONAP private network CIDR
87 description: The CIDR of the protected private network
90 label: vFirewall private IP address towards the unprotected network
91 description: Private IP address that is assigned to the vFirewall to communicate with the vPacketGenerator
94 label: vFirewall private IP address towards the protected network
95 description: Private IP address that is assigned to the vFirewall to communicate with the vSink
98 label: vFirewall private IP address towards the ONAP management network
99 description: Private IP address that is assigned to the vFirewall to communicate with ONAP components
102 label: vPacketGenerator private IP address towards the unprotected network
103 description: Private IP address that is assigned to the vPacketGenerator to communicate with the vFirewall
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)
115 vfw_private_1_port_vnic_type:
117 description: vfw port 1 vnic type (normal, direct)
118 vfw_private_2_port_vnic_type:
120 description: vfw port 2 vnic type (normal, direct)
121 vsn_private_0_port_vnic_type:
123 description: vsn port 0 vnic type (normal, direct)
124 vsn_private_1_port_vnic_type:
126 description: vsn port 1 vnic type (normal, direct)
129 label: vFirewall name
130 description: Name of the vFirewall
134 description: Name of the vSink
138 description: The VNF ID is provided by ONAP
141 label: vFirewall module ID
142 description: The vFirewall Module ID is provided by ONAP
145 label: DCAE collector IP address
146 description: IP address of the DCAE collector
149 label: DCAE collector port
150 description: Port of the DCAE collector
154 description: Public/Private key pair name
158 description: Public key to be installed on the compute instance
159 install_script_version:
161 label: Installation script version number
162 description: Version number of the scripts that install the vFW demo app
163 demo_artifacts_version:
165 label: Artifacts version used in demo vnfs
166 description: Artifacts (jar, tar.gz) version used in demo vnfs
169 description: Root URL for the Nexus repository for Maven artifacts.
170 default: "https://nexus.onap.org"
173 label: Cloud environment
174 description: Cloud environment (e.g., openstack, rackspace)
177 description: ONAP Security Group
187 type: OS::Heat::RandomString
192 type: OS::Nova::KeyPair
198 base: { get_param: key_name }
199 rand: { get_resource: random-str }
200 public_key: { get_param: pub_key }
201 save_private_key: false
203 unprotected_private_network:
204 type: OS::Neutron::Net
206 name: { get_param: unprotected_private_net_id }
208 unprotected_private_subnet:
209 type: OS::Neutron::Subnet
211 name: { get_param: unprotected_private_subnet_id }
212 network_id: { get_resource: unprotected_private_network }
213 cidr: { get_param: unprotected_private_net_cidr }
215 protected_private_network:
216 type: OS::Neutron::Net
218 name: { get_param: protected_private_net_id }
220 protected_private_subnet:
221 type: OS::Neutron::Subnet
223 name: { get_param: protected_private_subnet_id }
224 network_id: { get_resource: protected_private_network }
225 cidr: { get_param: protected_private_net_cidr }
227 # Virtual Firewall instantiation
229 type: OS::Neutron::Port
231 network: { get_resource: unprotected_private_network }
232 binding:vnic_type: { get_param: vfw_private_0_port_vnic_type}
233 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}]
235 - { get_param: sec_group }
238 type: OS::Neutron::Port
240 allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}]
241 network: { get_resource: protected_private_network }
242 binding:vnic_type: { get_param: vfw_private_1_port_vnic_type}
243 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}]
245 - { get_param: sec_group }
248 type: OS::Neutron::Port
250 network: { get_param: onap_private_net_id }
251 binding:vnic_type: { get_param: vfw_private_2_port_vnic_type}
252 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}]
254 - { get_param: sec_group }
257 type: OS::Nova::Server
259 image: { get_param: image_name }
260 flavor: { get_param: firewall_flavor_name }
261 name: { get_param: vfw_name_0 }
262 key_name: { get_resource: my_keypair }
264 - network: { get_param: public_net_id }
265 - port: { get_resource: vfw_private_0_port }
266 - port: { get_resource: vfw_private_1_port }
267 - port: { get_resource: vfw_private_2_port }
268 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
269 user_data_format: RAW
273 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
274 __dcae_collector_port__ : { get_param: dcae_collector_port }
275 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
276 __install_script_version__ : { get_param: install_script_version }
277 __vfw_private_ip_0__ : { get_param: vfw_private_ip_0 }
278 __vfw_private_ip_1__ : { get_param: vfw_private_ip_1 }
279 __vfw_private_ip_2__ : { get_param: vfw_private_ip_2 }
280 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
281 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
282 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
283 __cloud_env__ : { get_param: cloud_env }
284 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
288 # Create configuration files
290 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
291 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
292 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
293 echo "__install_script_version__" > /opt/config/install_script_version.txt
294 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
295 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
296 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
297 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
298 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
299 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
300 echo "__cloud_env__" > /opt/config/cloud_env.txt
301 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
303 # Download and run install script
305 apt-get -y install unzip
306 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
307 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
308 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_firewall_install.sh
310 chmod +x v_firewall_install.sh
311 ./v_firewall_install.sh
314 # Virtual Sink instantiation
316 type: OS::Neutron::Port
318 network: { get_resource: protected_private_network }
319 binding:vnic_type: { get_param: vsn_private_0_port_vnic_type}
320 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}]
322 - { get_param: sec_group }
325 type: OS::Neutron::Port
327 network: { get_param: onap_private_net_id }
328 binding:vnic_type: { get_param: vsn_private_1_port_vnic_type}
329 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}]
331 - { get_param: sec_group }
334 type: OS::Nova::Server
336 image: { get_param: image_name }
337 flavor: { get_param: sink_flavor_name }
338 name: { get_param: vsn_name_0 }
339 key_name: { get_resource: my_keypair }
341 - network: { get_param: public_net_id }
342 - port: { get_resource: vsn_private_0_port }
343 - port: { get_resource: vsn_private_1_port }
344 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
345 user_data_format: RAW
349 __protected_net_gw__: { get_param: vfw_private_ip_1 }
350 __unprotected_net__: { get_param: unprotected_private_net_cidr }
351 __install_script_version__ : { get_param: install_script_version }
352 __vsn_private_ip_0__ : { get_param: vsn_private_ip_0 }
353 __vsn_private_ip_1__ : { get_param: vsn_private_ip_1 }
354 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
355 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
356 __cloud_env__ : { get_param: cloud_env }
357 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
361 # Create configuration files
363 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
364 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
365 echo "__install_script_version__" > /opt/config/install_script_version.txt
366 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
367 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
368 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
369 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
370 echo "__cloud_env__" > /opt/config/cloud_env.txt
371 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
373 # Download and run install script
375 apt-get -y install unzip
376 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
377 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
378 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_sink_install.sh
380 chmod +x v_sink_install.sh