[SDC-29] Amdocs OnBoard 1707 initial commit.
[sdc.git] / openecomp-be / lib / openecomp-sdc-translator-lib / att-sdc-translator-impl / src / test / resources / mock / services / heattotosca / attValetGroupAssignment / groupNameParameter / inputfiles / vIPR-ATM-Base.yaml
1 heat_template_version: 2015-04-30
2
3 description: >
4   HOT template to create the vIPR-ATM firwall service template and instance.
5   This template creates the following
6   - Two service virtual networks for each side (left and right) of the vIPR-ATM firewalls
7   - Two virtual networks for high availability between the vIPR-ATM firewalls
8   - A Contrail Service Template for the vIPR-ATM service
9   - A Contrail Service Instance for the vIPR-ATM service
10
11   The firewall virtual machines connected to these created networks and managed by the
12   vIPR-ATM service instance will be created by the vIPR-ATM-Instance.yaml HOT template.
13
14   Network Policy that includes the vIPR-ATM service instance will be created by client
15   specific HOT templates or Contrail APIs. 
16
17 parameters:
18   vipr_atm_service_left_ip_prefix:
19     type: string
20     constraints:
21       - allowed_pattern: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
22         description: A valid IPv4 dot quad IP address.
23     description: Left vIPR-ATM service network IP address prefix
24   vipr_atm_service_left_ip_prefix_len:
25     type: number
26     constraints:
27       - range: { min: 0, max: 32 }
28         description: a valid IPv4 prefix value from 0 to 32.
29     description: Left vIPR-ATM service network IP address prefix length
30
31   vipr_atm_service_right_ip_prefix:
32     type: string
33     constraints:
34       - allowed_pattern: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
35         description: A valid IPv4 dot quad IP address.
36     description: Right vIPR-ATM service network IP address prefix
37   vipr_atm_service_right_ip_prefix_len:
38     type: number
39     constraints:
40       - range: { min: 0, max: 32 }
41         description: a valid IPv4 prefix value from 0 to 32.
42     description: Right vIPR-ATM service network IP address prefix length
43
44   vipr_atm_ha_one_cidr:
45     type: string
46     constraints:
47       - allowed_pattern: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(?:3[0-2]|[12]?[0-9])$
48         description: A valid IPv4 CIDR (dot quad IP address / previx value 0 to 32).
49     description: vIPR-ATM private High Availability Network One IP address CIDR
50
51   vipr_atm_ha_two_cidr:
52     type: string
53     constraints:
54       - allowed_pattern: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(?:3[0-2]|[12]?[0-9])$
55         description: A valid IPv4 CIDR (dot quad IP address / previx value 0 to 32).
56     description: vIPR-ATM private High Availability Network Two IP address CIDR
57
58   vnf_id:
59     type: string
60     description: Unique ID for this VNF instance
61   vnf_name:
62     type: string
63     description: Unique name for this VNF instance
64   vf_module_id:
65     type: string
66     description: Unique ID for the VF Module instance
67
68 resources:
69   vIPR_ATM_Service_Left:
70     type: OS::ContrailV2::VirtualNetwork
71     properties:
72       name:
73         str_replace:
74           template: VNF_NAME_VIPR_ATM_SERVICE_LEFT_NETWORK
75           params:
76             VNF_NAME: { get_param: vnf_name }
77       network_ipam_refs: ["default-domain:default-project:default-network-ipam"]
78       network_ipam_refs_data:
79         [{
80         network_ipam_refs_data_ipam_subnets:
81           [{
82           network_ipam_refs_data_ipam_subnets_subnet:
83             {
84             network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
85               {
86               get_param: vipr_atm_service_left_ip_prefix
87               },
88             network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
89               {
90               get_param: vipr_atm_service_left_ip_prefix_len
91               },
92             },
93           }]
94         }]
95
96   vIPR_ATM_Service_Right:
97     type: OS::ContrailV2::VirtualNetwork
98     properties:
99       name:
100         str_replace:
101           template: VNF_NAME_VIPR_ATM_SERVICE_RIGHT_NETWORK
102           params:
103             VNF_NAME: { get_param: vnf_name }
104       network_ipam_refs: ["default-domain:default-project:default-network-ipam"]
105       network_ipam_refs_data:
106         [{
107         network_ipam_refs_data_ipam_subnets:
108           [{
109           network_ipam_refs_data_ipam_subnets_subnet:
110             {
111             network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
112               {
113               get_param: vipr_atm_service_right_ip_prefix
114               },
115             network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
116               {
117               get_param: vipr_atm_service_right_ip_prefix_len
118               },
119             },
120           }]
121         }]
122
123   vIPR_ATM_Ha_One:
124     type: OS::Neutron::Net
125     properties:
126       name:
127         str_replace:
128           template: VNF_NAME_VIPR_ATM_HA_ONE_NETWORK
129           params:
130             VNF_NAME: { get_param: vnf_name }
131
132   vIPR_ATM_Ha_One_Subnet:
133     type: OS::Neutron::Subnet
134     depends_on: 
135       - vIPR_ATM_Ha_One
136     properties:
137       name:
138         str_replace:
139           template: NET_NAME_SUBNET
140           params:
141             NET_NAME: { get_attr: [ vIPR_ATM_Ha_One, name ] }
142       network: { get_resource: vIPR_ATM_Ha_One }
143       cidr: { get_param: vipr_atm_ha_one_cidr }
144       enable_dhcp: False
145       gateway_ip: null
146
147   vIPR_ATM_Ha_Two:
148     type: OS::Neutron::Net
149     properties:
150       name:
151         str_replace:
152           template: VNF_NAME_VIPR_ATM_HA_TWO_NETWORK
153           params:
154             VNF_NAME: { get_param: vnf_name }
155
156   vIPR_ATM_Ha_Two_Subnet:
157     type: OS::Neutron::Subnet
158     depends_on: 
159       - vIPR_ATM_Ha_Two
160     properties:
161       name:
162         str_replace:
163           template: NET_NAME_SUBNET
164           params:
165             NET_NAME: { get_attr: [ vIPR_ATM_Ha_Two, name ] }
166       network: { get_resource: vIPR_ATM_Ha_Two }
167       cidr: { get_param: vipr_atm_ha_two_cidr }
168       enable_dhcp: False
169       gateway_ip: null
170
171   vIPR_ATM_Service_Template:
172     type: OS::ContrailV2::ServiceTemplate
173     properties:
174       name:
175         str_replace:
176           template: VNF_NAME_VIPR_ATM_SERVICE_TEMPLATE
177           params:
178             VNF_NAME: { get_param: vnf_name }
179       service_template_properties:
180         {
181         service_template_properties_version: 2,
182         service_template_properties_service_mode: transparent,
183         service_template_properties_service_type: firewall,
184         service_template_properties_service_virtualization_type: virtual-machine,
185         service_template_properties_interface_type:
186           [
187           {
188           service_template_properties_interface_type_service_interface_type: Left,
189           service_template_properties_interface_type_shared_ip: True,
190           },
191           {
192           service_template_properties_interface_type_service_interface_type: Right,
193           service_template_properties_interface_type_shared_ip: True,
194           }
195           ],
196         }
197       domain: default-domain
198
199   vIPR_ATM_Service_Instance:
200     type: OS::ContrailV2::ServiceInstance
201     depends_on: 
202       - vIPR_ATM_Service_Left
203       - vIPR_ATM_Service_Right
204       - vIPR_ATM_Service_Template
205     properties:
206       name:
207         str_replace:
208           template: VNF_NAME_VIPR_ATM_SERVICE_INSTANCE
209           params:
210             VNF_NAME: { get_param: vnf_name }
211       service_template_refs: [{ get_resource: vIPR_ATM_Service_Template }]
212       service_instance_properties:
213         {
214         service_instance_properties_ha_mode: active-active,
215         service_instance_properties_left_virtual_network: 
216           {
217           list_join: [':', { get_attr: [ vIPR_ATM_Service_Left, fq_name ] } ]
218           },
219         service_instance_properties_right_virtual_network: 
220           {
221           list_join: [':', { get_attr: [ vIPR_ATM_Service_Right, fq_name ] } ]
222           },
223         }
224   
225   # Management (OAM) Port Security Group to allow ingress SSH 
226   vIPR_ATM_OAM_SG:
227     type: OS::Neutron::SecurityGroup
228     properties:
229       name: 
230         str_replace:
231           template: VNF_NAME_VIPR_ATM_OAM_SG
232           params:
233             VNF_NAME: { get_param: vnf_name }
234       rules:
235         - remote_ip_prefix: 0.0.0.0/0
236           protocol: tcp
237           port_range_min: 22
238           port_range_max: 22
239         - remote_ip_prefix: 0.0.0.0/0
240           protocol: tcp
241           port_range_min: 443
242           port_range_max: 443
243         - remote_ip_prefix: 0.0.0.0/0
244           protocol: tcp
245           port_range_min: 3978
246           port_range_max: 3978
247         - remote_ip_prefix: 0.0.0.0/0
248           protocol: icmp
249
250   vIPR_ATM_HA_ONE_SG:
251     type: OS::Neutron::SecurityGroup
252     properties:
253       name:
254         str_replace:
255           template: VNF_NAME_VIPR_ATM_HA_ONE_SG
256           params:
257             VNF_NAME: { get_param: vnf_name }
258       rules:
259         - remote_mode: remote_group_id
260
261   vIPR_ATM_HA_TWO_SG:
262     type: OS::Neutron::SecurityGroup
263     properties:
264       name:
265         str_replace:
266           template: VNF_NAME_VIPR_ATM_HA_TWO_SG
267           params:
268             VNF_NAME: { get_param: vnf_name }
269       rules:
270         - remote_mode: remote_group_id
271
272   vIPR_ATM_Server_Group:
273     type: OS::Nova::ServerGroup
274     properties:
275       name:
276         str_replace:
277           template: VNF_NAME_VIPR_ATM_SERVER_GROUP
278           params:
279             VNF_NAME: { get_param: vnf_name }
280       policies: 
281         - anti-affinity
282
283 outputs:
284   vipr_atm_contrail_service_instance_fqdn:
285     description: The FQDN for the Contrail Service Instance that is needed to create tenant OAM network policy to service change through the vIPR-ATM firewall.
286     value: { list_join: [':', { get_attr: [ vIPR_ATM_Service_Instance, fq_name ] } ] }
287
288   vipr_atm_service_left_fqdn:
289     description: The FQDN for the vIPR-ATM Service Left network.
290     value: { list_join: [':', { get_attr: [ vIPR_ATM_Service_Left, fq_name ] } ] }
291
292   vipr_atm_service_right_fqdn:
293     description: The FQDN for the vIPR-ATM Service Right network.
294     value: { list_join: [':', { get_attr: [ vIPR_ATM_Service_Right, fq_name ] } ] }
295
296   vipr_atm_ha_one_id:
297     description: The UUID for the vIPR-ATM HA One network.
298     value: { get_resource: vIPR_ATM_Ha_One }
299
300   vipr_atm_ha_two_id:
301     description: The UUID for the vIPR-ATM HA Two network.
302     value: { get_resource: vIPR_ATM_Ha_Two }
303
304   vipr_atm_oam_net_security_groups:
305     description: The list of OpenStack Security Groups to appliy to the vIPR-ATM-Instance\'s OAM network.
306     value: [ { get_resource: vIPR_ATM_OAM_SG } ]
307
308   vipr_atm_ha_one_security_groups:
309     description: The list of OpenStack Security Groups to appliy to the vIPR-ATM-Instance\'s HA One network.
310     value: [ { get_resource: vIPR_ATM_HA_ONE_SG } ]
311
312   vipr_atm_ha_two_security_groups:
313     description: The list of OpenStack Security Groups to appliy to the vIPR-ATM-Instance\'s HA Two network.
314     value: [ { get_resource: vIPR_ATM_HA_TWO_SG } ]
315
316   vipr_atm_server_group:
317     description: The UUID for the vIPR-ATM OpenStack Server Group
318     value: { get_resource: vIPR_ATM_Server_Group }