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)
116 vfw_private_1_port_vnic_type:
118 description: vfw port 1 vnic type (normal, direct)
120 vfw_private_2_port_vnic_type:
122 description: vfw port 2 vnic type (normal, direct)
124 vsn_private_0_port_vnic_type:
126 description: vsn port 0 vnic type (normal, direct)
128 vsn_private_1_port_vnic_type:
130 description: vsn port 1 vnic type (normal, direct)
134 label: vFirewall name
135 description: Name of the vFirewall
139 description: Name of the vSink
143 description: The VNF ID 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.
175 default: "https://nexus.onap.org"
178 label: Cloud environment
179 description: Cloud environment (e.g., openstack, rackspace)
182 description: ONAP Security Group
192 type: OS::Heat::RandomString
197 type: OS::Nova::KeyPair
203 base: { get_param: key_name }
204 rand: { get_resource: random-str }
205 public_key: { get_param: pub_key }
206 save_private_key: false
208 unprotected_private_network:
209 type: OS::Neutron::Net
211 name: { get_param: unprotected_private_net_id }
213 unprotected_private_subnet:
214 type: OS::Neutron::Subnet
216 name: { get_param: unprotected_private_subnet_id }
217 network_id: { get_resource: unprotected_private_network }
218 cidr: { get_param: unprotected_private_net_cidr }
220 protected_private_network:
221 type: OS::Neutron::Net
223 name: { get_param: protected_private_net_id }
225 protected_private_subnet:
226 type: OS::Neutron::Subnet
228 name: { get_param: protected_private_subnet_id }
229 network_id: { get_resource: protected_private_network }
230 cidr: { get_param: protected_private_net_cidr }
232 # Virtual Firewall instantiation
234 type: OS::Neutron::Port
236 network: { get_resource: unprotected_private_network }
237 binding:vnic_type: { get_param: vfw_private_0_port_vnic_type}
238 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}]
240 - { get_param: sec_group }
243 type: OS::Neutron::Port
245 allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}]
246 network: { get_resource: protected_private_network }
247 binding:vnic_type: { get_param: vfw_private_1_port_vnic_type}
248 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}]
250 - { get_param: sec_group }
253 type: OS::Neutron::Port
255 network: { get_param: onap_private_net_id }
256 binding:vnic_type: { get_param: vfw_private_2_port_vnic_type}
257 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}]
259 - { get_param: sec_group }
262 type: OS::Nova::Server
264 image: { get_param: image_name }
265 flavor: { get_param: firewall_flavor_name }
266 name: { get_param: vfw_name_0 }
267 key_name: { get_resource: my_keypair }
269 - network: { get_param: public_net_id }
270 - port: { get_resource: vfw_private_0_port }
271 - port: { get_resource: vfw_private_1_port }
272 - port: { get_resource: vfw_private_2_port }
273 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
274 user_data_format: RAW
278 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
279 __dcae_collector_port__ : { get_param: dcae_collector_port }
280 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
281 __install_script_version__ : { get_param: install_script_version }
282 __vfw_private_ip_0__ : { get_param: vfw_private_ip_0 }
283 __vfw_private_ip_1__ : { get_param: vfw_private_ip_1 }
284 __vfw_private_ip_2__ : { get_param: vfw_private_ip_2 }
285 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
286 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
287 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
288 __cloud_env__ : { get_param: cloud_env }
289 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
293 # Create configuration files
295 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
296 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
297 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
298 echo "__install_script_version__" > /opt/config/install_script_version.txt
299 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
300 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
301 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
302 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
303 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
304 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
305 echo "__cloud_env__" > /opt/config/cloud_env.txt
306 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
308 # Download and run install script
310 apt-get -y install unzip
311 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
312 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
313 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_firewall_install.sh
315 chmod +x v_firewall_install.sh
316 ./v_firewall_install.sh
319 # Virtual Sink instantiation
321 type: OS::Neutron::Port
323 network: { get_resource: protected_private_network }
324 binding:vnic_type: { get_param: vsn_private_0_port_vnic_type}
325 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}]
327 - { get_param: sec_group }
330 type: OS::Neutron::Port
332 network: { get_param: onap_private_net_id }
333 binding:vnic_type: { get_param: vsn_private_1_port_vnic_type}
334 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}]
336 - { get_param: sec_group }
339 type: OS::Nova::Server
341 image: { get_param: image_name }
342 flavor: { get_param: sink_flavor_name }
343 name: { get_param: vsn_name_0 }
344 key_name: { get_resource: my_keypair }
346 - network: { get_param: public_net_id }
347 - port: { get_resource: vsn_private_0_port }
348 - port: { get_resource: vsn_private_1_port }
349 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
350 user_data_format: RAW
354 __protected_net_gw__: { get_param: vfw_private_ip_1 }
355 __unprotected_net__: { get_param: unprotected_private_net_cidr }
356 __install_script_version__ : { get_param: install_script_version }
357 __vsn_private_ip_0__ : { get_param: vsn_private_ip_0 }
358 __vsn_private_ip_1__ : { get_param: vsn_private_ip_1 }
359 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
360 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
361 __cloud_env__ : { get_param: cloud_env }
362 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
366 # Create configuration files
368 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
369 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
370 echo "__install_script_version__" > /opt/config/install_script_version.txt
371 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
372 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
373 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
374 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
375 echo "__cloud_env__" > /opt/config/cloud_env.txt
376 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
378 # Download and run install script
380 apt-get -y install unzip
381 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
382 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
383 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_sink_install.sh
385 chmod +x v_sink_install.sh