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
142 label: Repository URL
143 description: URL of the repository that hosts the demo packages
144 install_script_version:
146 label: Installation script version number
147 description: Version number of the scripts that install the vFW demo app
148 demo_artifacts_version:
150 label: Artifacts version used in demo vnfs
151 description: Artifacts (jar, tar.gz) version used in demo vnfs
154 description: Root URL for the Nexus repository for Maven artifacts.
155 default: "https://nexus.onap.org"
158 label: Cloud environment
159 description: Cloud environment (e.g., openstack, rackspace)
169 type: OS::Heat::RandomString
174 type: OS::Nova::KeyPair
180 base: { get_param: key_name }
181 rand: { get_resource: random-str }
182 public_key: { get_param: pub_key }
183 save_private_key: false
185 unprotected_private_network:
186 type: OS::Neutron::Net
188 name: { get_param: unprotected_private_net_id }
190 unprotected_private_subnet:
191 type: OS::Neutron::Subnet
193 name: { get_param: unprotected_private_subnet_id }
194 network_id: { get_resource: unprotected_private_network }
195 cidr: { get_param: unprotected_private_net_cidr }
197 protected_private_network:
198 type: OS::Neutron::Net
200 name: { get_param: protected_private_net_id }
202 protected_private_subnet:
203 type: OS::Neutron::Subnet
205 name: { get_param: protected_private_subnet_id }
206 network_id: { get_resource: protected_private_network }
207 cidr: { get_param: protected_private_net_cidr }
209 # Virtual Firewall instantiation
211 type: OS::Neutron::Port
213 network: { get_resource: unprotected_private_network }
214 fixed_ips: [{"subnet": { get_resource: unprotected_private_subnet }, "ip_address": { get_param: vfw_private_ip_0 }}]
217 type: OS::Neutron::Port
219 allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}]
220 network: { get_resource: protected_private_network }
221 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vfw_private_ip_1 }}]
224 type: OS::Neutron::Port
226 network: { get_param: onap_private_net_id }
227 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_private_ip_2 }}]
230 type: OS::Nova::Server
232 image: { get_param: image_name }
233 flavor: { get_param: flavor_name }
234 name: { get_param: vfw_name_0 }
235 key_name: { get_resource: my_keypair }
237 - network: { get_param: public_net_id }
238 - port: { get_resource: vfw_private_0_port }
239 - port: { get_resource: vfw_private_1_port }
240 - port: { get_resource: vfw_private_2_port }
241 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
242 user_data_format: RAW
246 __dcae_collector_ip__ : { get_param: dcae_collector_ip }
247 __dcae_collector_port__ : { get_param: dcae_collector_port }
248 __repo_url_artifacts__ : { get_param: repo_url_artifacts }
249 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
250 __install_script_version__ : { get_param: install_script_version }
251 __vfw_private_ip_0__ : { get_param: vfw_private_ip_0 }
252 __vfw_private_ip_1__ : { get_param: vfw_private_ip_1 }
253 __vfw_private_ip_2__ : { get_param: vfw_private_ip_2 }
254 __unprotected_private_net_cidr__ : { get_param: unprotected_private_net_cidr }
255 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
256 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
257 __cloud_env__ : { get_param: cloud_env }
258 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
262 # Create configuration files
264 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
265 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
266 echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
267 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
268 echo "__install_script_version__" > /opt/config/install_script_version.txt
269 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
270 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
271 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
272 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
273 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
274 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
275 echo "__cloud_env__" > /opt/config/cloud_env.txt
276 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
278 # Download and run install script
279 apt-get -y install unzip
280 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
281 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
282 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_firewall_install.sh
284 chmod +x v_firewall_install.sh
285 ./v_firewall_install.sh
288 # Virtual Sink instantiation
290 type: OS::Neutron::Port
292 network: { get_resource: protected_private_network }
293 fixed_ips: [{"subnet": { get_resource: protected_private_subnet }, "ip_address": { get_param: vsn_private_ip_0 }}]
296 type: OS::Neutron::Port
298 network: { get_param: onap_private_net_id }
299 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_private_ip_1 }}]
302 type: OS::Nova::Server
304 image: { get_param: image_name }
305 flavor: { get_param: flavor_name }
306 name: { get_param: vsn_name_0 }
307 key_name: { get_resource: my_keypair }
309 - network: { get_param: public_net_id }
310 - port: { get_resource: vsn_private_0_port }
311 - port: { get_resource: vsn_private_1_port }
312 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
313 user_data_format: RAW
317 __protected_net_gw__: { get_param: vfw_private_ip_1 }
318 __unprotected_net__: { get_param: unprotected_private_net_cidr }
319 __repo_url_artifacts__ : { get_param: repo_url_artifacts }
320 __install_script_version__ : { get_param: install_script_version }
321 __vsn_private_ip_0__ : { get_param: vsn_private_ip_0 }
322 __vsn_private_ip_1__ : { get_param: vsn_private_ip_1 }
323 __protected_private_net_cidr__ : { get_param: protected_private_net_cidr }
324 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
325 __cloud_env__ : { get_param: cloud_env }
326 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
330 # Create configuration files
332 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
333 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
334 echo "__install_script_version__" > /opt/config/install_script_version.txt
335 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
336 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
337 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
338 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
339 echo "__cloud_env__" > /opt/config/cloud_env.txt
340 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
342 # Download and run install script
343 apt-get -y install unzip
344 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
345 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
346 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_sink_install.sh
348 chmod +x v_sink_install.sh