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 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 int_private1_net_cidr:
50 label: Unprotected private network CIDR
51 description: The CIDR of the unprotected private network
54 label: Protected private network name or ID
55 description: Private network that connects vFirewall with vSink
56 int_private2_subnet_id:
58 label: Protected private subnetwork name or ID
59 description: Private subnetwork of the unprotected network
60 int_private2_net_cidr:
62 label: Protected private network CIDR
63 description: The CIDR of the protected private network
66 label: ONAP management network name or ID
67 description: Private network that connects ONAP components and the VNF
68 onap_private_subnet_id:
70 label: ONAP management sub-network name or ID
71 description: Private sub-network that connects ONAP components and the VNF
72 onap_private_net_cidr:
74 label: ONAP private network CIDR
75 description: The CIDR of the protected private network
76 vfw_int_private2_ip_0:
78 label: vFirewall private IP address towards the protected network
79 description: Private IP address that is assigned to the vFirewall to communicate with the vSink
80 vsn_int_private2_ip_0:
82 label: vSink private IP address towards the protected network
83 description: Private IP address that is assigned to the vSink to communicate with the vFirewall
84 vsn_onap_private_ip_0:
86 label: vSink private IP address towards the ONAP management network
87 description: Private IP address that is assigned to the vSink to communicate with ONAP components
91 description: Name of the vSink
95 description: The VNF ID is provided by ONAP
99 description: The VNF NAME is provided by ONAP
103 description: The VF Module ID is provided by ONAP
107 description: Public/Private key pair name
108 install_script_version:
110 label: Installation script version number
111 description: Version number of the scripts that install the vFW demo app
112 #demo_artifacts_version:
114 # label: Artifacts version used in demo vnfs
115 # description: Artifacts (jar, tar.gz) version used in demo vnfs
118 description: Root URL for the Nexus repository for Maven artifacts.
119 # default: "https://nexus.onap.org"
122 label: Cloud environment
123 description: Cloud environment (e.g., openstack, rackspace)
126 description: ONAP Security Group
137 # Virtual Sink instantiation
138 vsn_0_int_private2_port_0:
139 type: OS::Neutron::Port
141 network: { get_param: int_private2_net_id }
142 fixed_ips: [{"subnet": { get_param: int_private2_subnet_id }, "ip_address": { get_param: vsn_int_private2_ip_0 }}]
144 - { get_param: sec_group }
146 vsn_0_onap_private_port_0:
147 type: OS::Neutron::Port
149 network: { get_param: onap_private_net_id }
150 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vsn_onap_private_ip_0 }}]
152 - { get_param: sec_group }
155 type: OS::Nova::Server
157 image: { get_param: vsn_image_name }
158 flavor: { get_param: vsn_flavor_name }
159 name: { get_param: vsn_name_0 }
160 key_name: { get_param: key_name }
162 - network: { get_param: public_net_id }
163 - port: { get_resource: vsn_0_int_private2_port_0 }
164 - port: { get_resource: vsn_0_onap_private_port_0 }
166 vnf_name: { get_param: vnf_name }
167 vnf_id: { get_param: vnf_id }
168 vf_module_id: { get_param: vf_module_id }
169 user_data_format: RAW
173 __protected_net_gw__: { get_param: vfw_int_private2_ip_0 }
174 __unprotected_net__: { get_param: int_private1_net_cidr }
175 __install_script_version__ : { get_param: install_script_version }
176 __vsn_private_ip_0__ : { get_param: vsn_int_private2_ip_0 }
177 __vsn_private_ip_1__ : { get_param: vsn_onap_private_ip_0 }
178 __protected_private_net_cidr__ : { get_param: int_private2_net_cidr }
179 __onap_private_net_cidr__ : { get_param: onap_private_net_cidr }
180 __cloud_env__ : { get_param: cloud_env }
181 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
185 # Create configuration files
187 echo "__protected_net_gw__" > /opt/config/protected_net_gw.txt
188 echo "__unprotected_net__" > /opt/config/unprotected_net.txt
189 echo "__install_script_version__" > /opt/config/install_script_version.txt
190 echo "__vsn_private_ip_0__" > /opt/config/vsn_private_ip_0.txt
191 echo "__vsn_private_ip_1__" > /opt/config/vsn_private_ip_1.txt
192 echo "__protected_private_net_cidr__" > /opt/config/protected_private_net_cidr.txt
193 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
194 echo "__cloud_env__" > /opt/config/cloud_env.txt
195 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
197 # Download and run install script
199 apt-get -y install unzip
200 if [[ "__install_script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
201 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
202 unzip -j /opt/vfw-scripts-__install_script_version__.zip -d /opt v_sink_install.sh
204 chmod +x v_sink_install.sh