1 ##########################################################################
3 #==================LICENSE_START==========================================
6 # Copyright (c) 2018 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 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
50 label: Unprotected private network name or ID
51 description: Private network that connects vPacketGenerator with vFirewall
52 int_private1_subnet_id:
54 label: Unprotected private subnetwork name or ID
55 description: Private subnetwork of the protected network
56 int_private1_net_cidr:
58 label: Unprotected private network CIDR
59 description: The CIDR of the unprotected private network
62 label: Protected private network name or ID
63 description: Private network that connects vFirewall with vSink
64 int_private2_subnet_id:
66 label: Protected private subnetwork name or ID
67 description: Private subnetwork of the unprotected network
68 int_private2_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
84 vfw_int_private1_ip_0:
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
88 vfw_int_private2_ip_0:
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
92 vfw_onap_private_ip_0:
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
96 vfw_int_private2_floating_ip:
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: vFirewall name
103 description: Name of the vFirewall
107 description: The VNF ID is provided by ONAP
111 description: The VNF ID is provided by ONAP
115 description: The VF Module ID is provided by ONAP
118 label: DCAE collector IP address
119 description: IP address of the DCAE collector
122 label: DCAE collector port
123 description: Port of the DCAE collector
127 description: Public/Private key pair name
128 install_script_version:
130 label: Installation script version number
131 description: Version number of the scripts that install the vFW demo app
132 demo_artifacts_version:
134 label: Artifacts version used in demo vnfs
135 description: Artifacts (jar, tar.gz) version used in demo vnfs
138 description: Root URL for the Nexus repository for Maven artifacts.
139 # default: "https://nexus.onap.org"
142 label: Cloud environment
143 description: Cloud environment (e.g., openstack, rackspace)
146 description: ONAP Security Group
157 # Virtual Firewall instantiation
158 vfw_0_int_private1_port_0:
159 type: OS::Neutron::Port
161 network: { get_param: int_private1_net_id }
162 fixed_ips: [{"subnet": { get_param: int_private1_subnet_id }, "ip_address": { get_param: vfw_int_private1_ip_0 }}]
164 - { get_param: sec_group }
166 vfw_0_int_private2_port_0:
167 type: OS::Neutron::Port
169 ### NOTE: THIS USED TO BE allowed_address_pairs: [{ "ip_address": { get_param: vpg_private_ip_0 }}]
170 allowed_address_pairs: [{ "ip_address": { get_param: vfw_int_private2_floating_ip }}]
171 network: { get_param: int_private2_net_id }
172 fixed_ips: [{"subnet": { get_param: int_private2_subnet_id }, "ip_address": { get_param: vfw_int_private2_ip_0 }}]
174 - { get_param: sec_group }
176 vfw_0_onap_private_port_0:
177 type: OS::Neutron::Port
179 network: { get_param: onap_private_net_id }
180 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vfw_onap_private_ip_0 }}]
182 - { get_param: sec_group }
185 type: OS::Nova::Server
187 image: { get_param: vfw_image_name }
188 flavor: { get_param: vfw_flavor_name }
189 name: { get_param: vfw_name_0 }
190 key_name: { get_param: key_name }
192 - network: { get_param: public_net_id }
193 - port: { get_resource: vfw_0_int_private1_port_0 }
194 - port: { get_resource: vfw_0_int_private2_port_0 }
195 - port: { get_resource: vfw_0_onap_private_port_0 }
197 vnf_name: { get_param: vnf_name }
198 vnf_id: { get_param: vnf_id }
199 vf_module_id: { get_param: vf_module_id }
200 user_data_format: RAW
204 __dcae_collector_ip__: { get_param: dcae_collector_ip }
205 __dcae_collector_port__: { get_param: dcae_collector_port }
206 __demo_artifacts_version__: { get_param: demo_artifacts_version }
207 __install_script_version__: { get_param: install_script_version }
208 __vfw_private_ip_0__: { get_param: vfw_int_private1_ip_0 }
209 __vfw_private_ip_1__: { get_param: vfw_int_private2_ip_0 }
210 __vfw_private_ip_2__: { get_param: vfw_onap_private_ip_0 }
211 __unprotected_private_net_cidr__: { get_param: int_private1_net_cidr }
212 __protected_private_net_cidr__: { get_param: int_private2_net_cidr }
213 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
214 __cloud_env__: { get_param: cloud_env }
215 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
219 # Create configuration files
221 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
222 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
223 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
224 echo "__install_script_version__" > /opt/config/install_script_version.txt
225 echo "__vfw_private_ip_0__" > /opt/config/vfw_private_ip_0.txt
226 echo "__vfw_private_ip_1__" > /opt/config/vfw_private_ip_1.txt
227 echo "__vfw_private_ip_2__" > /opt/config/vfw_private_ip_2.txt
228 echo "__unprotected_private_net_cidr__" > /opt/config/unprotected_private_net_cidr.txt
229 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
230 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
231 echo "__cloud_env__" > /opt/config/cloud_env.txt
232 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
234 # Download and run install script
236 apt-get -y install unzip
237 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
238 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
239 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_firewall_install.sh
241 chmod +x v_firewall_install.sh
242 ./v_firewall_install.sh