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: 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 unprotected_private_subnet_id:
54 label: Unprotected private subnetwork name or ID
55 description: Private subnetwork of the protected network
56 unprotected_private_net_cidr:
58 label: Unprotected private network CIDR
59 description: The CIDR of the unprotected private network
60 protected_private_net_id:
62 label: Protected private network name or ID
63 description: Private network that connects vFirewall with vSink
64 protected_private_subnet_id:
66 label: Protected private subnetwork name or ID
67 description: Private subnetwork of the unprotected network
68 protected_private_net_cidr:
70 label: Protected private network CIDR
71 description: The CIDR of the protected private network
74 label: ONAP management network name or ID
75 description: Private network that connects ONAP components and the VNF
76 onap_private_subnet_id:
78 label: ONAP management sub-network name or ID
79 description: Private sub-network that connects ONAP components and the VNF
80 onap_private_net_cidr:
82 label: ONAP private network CIDR
83 description: The CIDR of the protected private network
86 label: vFirewall private IP address towards the unprotected network
87 description: Private IP address that is assigned to the vFirewall to communicate with the vPacketGenerator
90 label: vFirewall private IP address towards the protected network
91 description: Private IP address that is assigned to the vFirewall to communicate with the vSink
94 label: vFirewall private IP address towards the ONAP management network
95 description: Private IP address that is assigned to the vFirewall to communicate with ONAP components
98 label: vPacketGenerator private IP address towards the unprotected network
99 description: Private IP address that is assigned to the vPacketGenerator to communicate with the vFirewall
102 label: vSink private IP address towards the protected network
103 description: Private IP address that is assigned to the vSink to communicate with the vFirewall
106 label: vSink private IP address towards the ONAP management network
107 description: Private IP address that is assigned to the vSink to communicate with ONAP components
110 label: vFirewall name
111 description: Name of the vFirewall
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 unprotected_private_subnet:
190 type: OS::Neutron::Subnet
192 name: { get_param: unprotected_private_subnet_id }
193 network_id: { get_resource: unprotected_private_network }
194 cidr: { get_param: unprotected_private_net_cidr }
196 protected_private_network:
197 type: OS::Neutron::Net
199 name: { get_param: protected_private_net_id }
201 protected_private_subnet:
202 type: OS::Neutron::Subnet
204 name: { get_param: protected_private_subnet_id }
205 network_id: { get_resource: protected_private_network }
206 cidr: { get_param: protected_private_net_cidr }
208 # Virtual Firewall instantiation
210 type: OS::Neutron::Port
212 network: { get_resource: unprotected_private_network }
213 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}]
215 - { get_param: sec_group }
218 type: OS::Neutron::Port
220 allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}]
221 network: { get_resource: protected_private_network }
222 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}]
224 - { get_param: sec_group }
227 type: OS::Neutron::Port
229 network: { get_param: onap_private_net_id }
230 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}]
232 - { get_param: sec_group }
235 type: OS::Nova::Server
237 image: { get_param: image_name }
238 flavor: { get_param: flavor_name }
239 name: { get_param: vfw_name_0 }
240 key_name: { get_resource: my_keypair }
242 - network: { get_param: public_net_id }
243 - port: { get_resource: vfw_private_0_port }
244 - port: { get_resource: vfw_private_1_port }
245 - port: { get_resource: vfw_private_2_port }
246 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
247 user_data_format: RAW
251 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
252 __dcae_collector_port__ : { get_param: dcae_collector_port }
253 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
254 __install_script_version__ : { get_param: install_script_version }
255 __vfw_private_ip_0__ : { get_param: vfw_private_ip_0 }
256 __vfw_private_ip_1__ : { get_param: vfw_private_ip_1 }
257 __vfw_private_ip_2__ : { get_param: vfw_private_ip_2 }
258 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
259 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
260 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
261 __cloud_env__ : { get_param: cloud_env }
262 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
266 # Create configuration files
268 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
269 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
270 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
271 echo "__install_script_version__" > /opt/config/install_script_version.txt
272 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
273 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
274 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
275 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
276 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
277 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
278 echo "__cloud_env__" > /opt/config/cloud_env.txt
279 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
281 # Download and run install script
283 apt-get -y install unzip
284 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
285 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
286 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_firewall_install.sh
288 chmod +x v_firewall_install.sh
289 ./v_firewall_install.sh
292 # Virtual Sink instantiation
294 type: OS::Neutron::Port
296 network: { get_resource: protected_private_network }
297 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}]
299 - { get_param: sec_group }
302 type: OS::Neutron::Port
304 network: { get_param: onap_private_net_id }
305 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}]
307 - { get_param: sec_group }
310 type: OS::Nova::Server
312 image: { get_param: image_name }
313 flavor: { get_param: flavor_name }
314 name: { get_param: vsn_name_0 }
315 key_name: { get_resource: my_keypair }
317 - network: { get_param: public_net_id }
318 - port: { get_resource: vsn_private_0_port }
319 - port: { get_resource: vsn_private_1_port }
320 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
321 user_data_format: RAW
325 __protected_net_gw__: { get_param: vfw_private_ip_1 }
326 __unprotected_net__: { get_param: unprotected_private_net_cidr }
327 __install_script_version__ : { get_param: install_script_version }
328 __vsn_private_ip_0__ : { get_param: vsn_private_ip_0 }
329 __vsn_private_ip_1__ : { get_param: vsn_private_ip_1 }
330 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
331 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
332 __cloud_env__ : { get_param: cloud_env }
333 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
337 # Create configuration files
339 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
340 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
341 echo "__install_script_version__" > /opt/config/install_script_version.txt
342 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
343 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
344 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
345 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
346 echo "__cloud_env__" > /opt/config/cloud_env.txt
347 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
349 # 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_sink_install.sh
356 chmod +x v_sink_install.sh