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
43 description: Type of instance (flavor) to be used
46 label: Image name or ID
47 description: Image to be used for compute instance
51 description: Type of instance (flavor) to be used
54 label: Public network name or ID
55 description: Public network that enables remote connection to VNF
56 int_unprotected_private_net_id:
58 label: Unprotected private network name or ID
59 description: Private network that connects vPacketGenerator with vFirewall
60 int_unprotected_private_subnet_id:
62 label: Unprotected private subnetwork name or ID
63 description: Private subnetwork of the protected network
64 unprotected_private_net_cidr:
66 label: Unprotected private network CIDR
67 description: The CIDR of the unprotected private network
68 int_protected_private_net_id:
70 label: Protected private network name or ID
71 description: Private network that connects vFirewall with vSink
72 int_protected_private_subnet_id:
74 label: Protected private subnetwork name or ID
75 description: Private subnetwork of the unprotected network
76 protected_private_net_cidr:
78 label: Protected private network CIDR
79 description: The CIDR of the protected private network
82 label: ONAP management network name or ID
83 description: Private network that connects ONAP components and the VNF
84 onap_private_subnet_id:
86 label: ONAP management sub-network name or ID
87 description: Private sub-network that connects ONAP components and the VNF
88 onap_private_net_cidr:
90 label: ONAP private network CIDR
91 description: The CIDR of the protected private network
92 vfw_int_unprotected_private_ip_0:
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
96 vfw_int_protected_private_ip_0:
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
100 vfw_onap_private_ip_0:
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
104 vfw_int_protected_private_floating_ip:
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
108 vsn_int_protected_private_ip_0:
110 label: vSink private IP address towards the protected network
111 description: Private IP address that is assigned to the vSink to communicate with the vFirewall
112 vsn_onap_private_ip_0:
114 label: vSink private IP address towards the ONAP management network
115 description: Private IP address that is assigned to the vSink to communicate with ONAP components
118 label: vFirewall name
119 description: Name of the vFirewall
123 description: Name of the vSink
127 description: The VNF NAME is provided by ONAP
131 description: The VNF ID is provided by ONAP
134 label: vFirewall module ID
135 description: The vFirewall Module ID is provided by ONAP
138 label: DCAE collector IP address
139 description: IP address of the DCAE collector
142 label: DCAE collector port
143 description: Port of the DCAE collector
147 description: Public/Private key pair name
151 description: Public key to be installed on the compute instance
152 install_script_version:
154 label: Installation script version number
155 description: Version number of the scripts that install the vFW demo app
156 demo_artifacts_version:
158 label: Artifacts version used in demo vnfs
159 description: Artifacts (jar, tar.gz) version used in demo vnfs
162 description: Root URL for the Nexus repository for Maven artifacts.
163 #default: "https://nexus.onap.org"
166 label: Cloud environment
167 description: Cloud environment (e.g., openstack, rackspace)
170 description: ONAP Security Group
180 type: OS::Heat::RandomString
185 type: OS::Nova::KeyPair
189 template: vnfname_base_rand
191 base: { get_param: key_name }
192 vnfname: { get_param: vnf_name }
193 rand: { get_resource: random-str }
194 public_key: { get_param: pub_key }
195 save_private_key: false
197 int_unprotected_private_network:
198 type: OS::Neutron::Net
202 template: vnfname_netid
204 netid: { get_param: int_unprotected_private_net_id }
205 vnfname: { get_param: vnf_name }
207 int_unprotected_private_subnet:
208 type: OS::Neutron::Subnet
212 template: vnfname_subnetid
214 subnetid: { get_param: int_unprotected_private_subnet_id }
215 vnfname: { get_param: vnf_name }
216 network: { get_resource: int_unprotected_private_network }
217 cidr: { get_param: unprotected_private_net_cidr }
219 int_protected_private_network:
220 type: OS::Neutron::Net
224 template: vnfname_netid
226 netid: { get_param: int_protected_private_net_id }
227 vnfname: { get_param: vnf_name }
229 int_protected_private_subnet:
230 type: OS::Neutron::Subnet
234 template: vnfname_subnetid
236 subnetid: { get_param: int_protected_private_subnet_id }
237 vnfname: { get_param: vnf_name }
238 network: { get_resource: int_protected_private_network }
239 cidr: { get_param: protected_private_net_cidr }
241 # Virtual Firewall instantiation
242 vfw_0_int_unprotected_private_port_0:
243 type: OS::Neutron::Port
245 network: { get_resource: int_unprotected_private_network }
246 fixed_ips: [{"subnet": { get_resource: int_unprotected_private_subnet }, "ip_address": { get_param: vfw_int_unprotected_private_ip_0 }}]
248 - { get_param: sec_group }
250 vfw_0_int_protected_private_port_0:
251 type: OS::Neutron::Port
253 allowed_address_pairs: [{ "ip_address": { get_param: vfw_int_protected_private_floating_ip }}]
254 network: { get_resource: int_protected_private_network }
255 fixed_ips: [{"subnet": { get_resource: int_protected_private_subnet }, "ip_address": { get_param: vfw_int_protected_private_ip_0 }}]
257 - { get_param: sec_group }
259 vfw_0_onap_private_port_0:
260 type: OS::Neutron::Port
262 network: { get_param: onap_private_net_id }
263 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_onap_private_ip_0 }}]
265 - { get_param: sec_group }
268 type: OS::Nova::Server
270 image: { get_param: vfw_image_name }
271 flavor: { get_param: vfw_flavor_name }
272 name: { get_param: vfw_name_0 }
273 key_name: { get_resource: my_keypair }
275 - network: { get_param: public_net_id }
276 - port: { get_resource: vfw_0_int_unprotected_private_port_0 }
277 - port: { get_resource: vfw_0_int_protected_private_port_0 }
278 - port: { get_resource: vfw_0_onap_private_port_0 }
280 vnf_name: { get_param: vnf_name }
281 vnf_id: { get_param: vnf_id }
282 vf_module_id: { get_param: vf_module_id }
283 user_data_format: RAW
287 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
288 __dcae_collector_port__ : { get_param: dcae_collector_port }
289 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
290 __install_script_version__ : { get_param: install_script_version }
291 __vfw_private_ip_0__ : { get_param: vfw_int_unprotected_private_ip_0 }
292 __vfw_private_ip_1__ : { get_param: vfw_int_protected_private_ip_0 }
293 __vfw_private_ip_2__ : { get_param: vfw_onap_private_ip_0 }
294 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
295 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
296 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
297 __cloud_env__ : { get_param: cloud_env }
298 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
302 # Create configuration files
304 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
305 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
306 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
307 echo "__install_script_version__" > /opt/config/install_script_version.txt
308 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
309 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
310 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
311 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
312 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
313 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
314 echo "__cloud_env__" > /opt/config/cloud_env.txt
315 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
317 # Download and run install script
319 apt-get -y install unzip
320 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
321 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
322 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_firewall_install.sh
324 chmod +x v_firewall_install.sh
325 ./v_firewall_install.sh
328 # Virtual Sink instantiation
329 vsn_0_int_protected_private_port_0:
330 type: OS::Neutron::Port
332 network: { get_resource: int_protected_private_network }
333 fixed_ips: [{"subnet": { get_resource: int_protected_private_subnet }, "ip_address": { get_param: vsn_int_protected_private_ip_0 }}]
335 - { get_param: sec_group }
337 vsn_0_onap_private_port_0:
338 type: OS::Neutron::Port
340 network: { get_param: onap_private_net_id }
341 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_onap_private_ip_0 }}]
343 - { get_param: sec_group }
346 type: OS::Nova::Server
348 image: { get_param: vsn_image_name }
349 flavor: { get_param: vsn_flavor_name }
350 name: { get_param: vsn_name_0 }
351 key_name: { get_resource: my_keypair }
353 - network: { get_param: public_net_id }
354 - port: { get_resource: vsn_0_int_protected_private_port_0 }
355 - port: { get_resource: vsn_0_onap_private_port_0 }
357 vnf_name: { get_param: vnf_name }
358 vnf_id: { get_param: vnf_id }
359 vf_module_id: { get_param: vf_module_id }
360 user_data_format: RAW
364 __protected_net_gw__: { get_param: vfw_int_protected_private_ip_0 }
365 __unprotected_net__: { get_param: unprotected_private_net_cidr }
366 __install_script_version__ : { get_param: install_script_version }
367 __vsn_private_ip_0__ : { get_param: vsn_int_protected_private_ip_0 }
368 __vsn_private_ip_1__ : { get_param: vsn_onap_private_ip_0 }
369 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
370 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
371 __cloud_env__ : { get_param: cloud_env }
372 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
376 # Create configuration files
378 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
379 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
380 echo "__install_script_version__" > /opt/config/install_script_version.txt
381 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
382 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
383 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
384 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
385 echo "__cloud_env__" > /opt/config/cloud_env.txt
386 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
388 # Download and run install script
390 apt-get -y install unzip
391 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
392 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
393 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_sink_install.sh
395 chmod +x v_sink_install.sh