[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-Instance.yaml
1 heat_template_version: 2015-04-30
2
3 description: >
4   HOT template to create a vIPR-ATM firwall service instance.
5   This template creates the following
6   - Contrail Port Tuple for this firwall service instance
7   - Virtual machine interfaces and IP addresses attached to the two 
8   service virtual networks.  These virtual machine interfaces will be used
9   by the vIPR firewall service instance
10   - Neutron ports for OAM, HA0, and HA1 networks
11   - OS::Nova::Server with the created virtual machine interface and ports. This
12   is the firewall service instance virtual machine.
13
14 parameters:
15   oam_net_id:
16     type: string
17     constraints:
18       - custom_constraint: neutron.network
19         description: This network must currently exist.
20     description: Neutron UUID for the managemnet network name of the vIPR-ATM firewall
21   vipr_atm_oam_net_security_groups:
22     type: comma_delimited_list
23     description: List of the security group to apply to the vIPR-ATM firewall management port
24
25   vipr_atm_service_left_fqdn:
26     type: string
27     constraints:
28       - allowed_pattern: ^(?:[^:]{1,64}:){2}(?:[^:]{1,255})$
29         description: |
30           A valid Contrail FQDN that contains three parts seperated by ':'.
31           The first two part are 1 to 64 characters long and must not contain ':'.
32           The third part is 1 to 255 characters long and must not contain ':'.
33     description: FQDN of the Left service network for the vIPR-ATM firewall
34
35   vipr_atm_service_right_fqdn:
36     type: string
37     constraints:
38       - allowed_pattern: ^(?:[^:]{1,64}:){2}(?:[^:]{1,255})$
39         description: |
40           A valid Contrail FQDN that contains three parts seperated by ':'.
41           The first two part are 1 to 64 characters long and must not contain ':'.
42           The third part is 1 to 255 characters long and must not contain ':'.
43     description: FQDN of the Right service network for the vIPR-ATM firewall
44
45   vipr_atm_ha_one_id:
46     type: string
47     constraints:
48       - custom_constraint: neutron.network
49         description: This network must currently exist.
50     description: Neutron UUID of the first high availability network for the vIPR-ATM firewall
51   vipr_atm_ha_one_ip_0:
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]?)$
55         description: A valid IPv4 dot quad IP address.
56     description: Fixed IP to apply to the vIPR-ATM firewall ha0 port
57   vipr_atm_ha_one_security_groups:
58     type: comma_delimited_list
59     description: List of the security group to apply to the vIPR-ATM firewall ha0 port
60
61   vipr_atm_ha_two_id:
62     type: string
63     constraints:
64       - custom_constraint: neutron.network
65         description: This network must currently exist.
66     description: Neutron UUID of the second high availability network for the vIPR-ATM firewal
67   vipr_atm_ha_two_ip_0:
68     type: string
69     constraints:
70       - 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]?)$
71         description: A valid IPv4 dot quad IP address.
72     description: Fixed IP to apply to the vIPR-ATM firewall ha1 port
73   vipr_atm_ha_two_security_groups:
74     type: comma_delimited_list
75     description: List of the security group to apply to the vIPR-ATM firewall ha1 port
76
77   vipr_atm_contrail_service_instance_fqdn:
78     type: string
79     constraints:
80       - allowed_pattern: ^(?:[^:]{1,64}:){2}(?:[^:]{1,255})$
81         description: |
82           A valid Contrail FQDN that contains three parts seperated by ':'.
83           The first two part are 1 to 64 characters long and must not contain ':'.
84           The third part is 1 to 255 characters long and must not contain ':'.
85     description: FQDN of the vIPR-ATM firewall Contrail service instance for the port tuple
86
87   vipr_atm_name_0:
88     type: string
89     constraints:
90       - length: { min: 1, max: 255 }
91         description: A string with length of at least 1 and less than 255.
92     description: Name of the vIPR-ATM firewall virtual machine
93   vipr_atm_image_name:
94     type: string
95     constraints:
96       - custom_constraint: glance.image
97         description: This image must currently exist.
98     description: Image name of the vIPR-ATM firewall virtual machine
99   vipr_atm_flavor_name:
100     type: string
101     constraints:
102       - custom_constraint: nova.flavor
103         description: This flavor must currently exist.
104     description: Flavor for the vIPR-ATM firewall virtual machine
105   vipr_atm_server_group:
106     type: string
107     constraints:
108       - length: { min: 1, max: 255 }
109         description: A string with length of at least 1 and less than 255.
110     description: Server Group with anti-affinity policy for the vIPR-ATM firewall virtual machine
111   vipr_atm_valet_eg_0:
112     type: string
113     constraints:
114       - length: { min: 1, max: 255 }
115         description: A string with length of at least 1 and less than 255.
116     description: The Valet 1.0 Exclusivity Group for the vIPR-ATM firewall virtual machine
117   availability_zone_0:
118     type: string
119     constraints:
120       - length: { min: 1, max: 255 }
121         description: A string with length of at least 1 and less than 255.
122     description: Availability Zone for the vIPR-ATM firewall virtual machine
123
124   vnf_id:
125     type: string
126     constraints:
127       - length: { min: 1, max: 255 }
128         description: A string with length of at least 1 and less than 255.
129     description: Unique ID for this VF instance
130   vnf_name:
131     type: string
132     constraints:
133       - length: { min: 1, max: 255 }
134         description: A string with length of at least 1 and less than 255.
135     description: Unique Name for this VF instance
136   vf_module_id:
137     type: string
138     constraints:
139       - length: { min: 1, max: 255 }
140         description: A string with length of at least 1 and less than 255.
141     description: Unique ID for the VF Module instance
142
143 resources:
144   # Create the Port Tuple
145   vIPR_ATM_RPT:
146     type: OS::ContrailV2::PortTuple
147     properties:
148       name:
149         str_replace:
150           template: VM_NAME_PORT_TUPLE
151           params:
152             VM_NAME: { get_param: vipr_atm_name_0 }
153       service_instance: { get_param: vipr_atm_contrail_service_instance_fqdn }
154
155   # Left Port (Virtual Machine Interface)
156   vIPR_ATM_Left_RVMI:
157     type: OS::ContrailV2::VirtualMachineInterface
158     depends_on: [ vIPR_ATM_RPT ]
159     properties:
160       name:
161         str_replace:
162           template: VM_NAME_PORT_3
163           params:
164             VM_NAME: { get_param: vipr_atm_name_0 }
165       virtual_machine_interface_properties:
166         {
167         virtual_machine_interface_properties_service_interface_type: 'left'
168         }
169       port_tuple_refs: [{ get_resource: vIPR_ATM_RPT }]
170       virtual_network_refs: [{ get_param: vipr_atm_service_left_fqdn }]
171
172   # Right Port (Virtual Machine Interface)
173   vIPR_ATM_Right_RVMI:
174     type: OS::ContrailV2::VirtualMachineInterface
175     depends_on: [ vIPR_ATM_RPT ]
176     properties:
177       name:
178         str_replace:
179           template: VM_NAME_PORT_4
180           params:
181             VM_NAME: { get_param: vipr_atm_name_0 }
182       virtual_machine_interface_properties:
183         {
184         virtual_machine_interface_properties_service_interface_type: 'right'
185         }
186       port_tuple_refs: [{ get_resource: vIPR_ATM_RPT }]
187       virtual_network_refs: [{ get_param: vipr_atm_service_right_fqdn }]
188       
189   # Left Instance IP
190   vIPR_ATM_Left_RII:
191     type: OS::ContrailV2::InstanceIp
192     depends_on: [ vIPR_ATM_Left_RVMI ]
193     properties:
194       name:
195         str_replace:
196           template: VM_NAME_INSTANCE_IP_LEFT
197           params:
198             VM_NAME: { get_param: vipr_atm_name_0 }
199       virtual_machine_interface_refs: [{ get_resource: vIPR_ATM_Left_RVMI }]
200       virtual_network_refs: [{ get_param: vipr_atm_service_left_fqdn }]
201
202   # Right Instance IP
203   vIPR_ATM_Right_RII:
204     type: OS::ContrailV2::InstanceIp
205     depends_on: [ vIPR_ATM_Right_RVMI ]
206     properties:
207       name:
208         str_replace:
209           template: VM_NAME_INSTANCE_IP_RIGHT
210           params:
211             VM_NAME: { get_param: vipr_atm_name_0 }
212       virtual_machine_interface_refs: [{ get_resource: vIPR_ATM_Right_RVMI }]
213       virtual_network_refs: [{ get_param: vipr_atm_service_right_fqdn }]
214
215   # OAM Network Port (not part of Port Tuple)
216   vIPR_ATM_OAM_0_Port:
217     type: OS::Neutron::Port
218     properties:
219       name:
220         str_replace:
221           template: VM_NAME_PORT_0
222           params:
223             VM_NAME: { get_param: vipr_atm_name_0 }
224       network: { get_param: oam_net_id }
225       security_groups: { get_param: vipr_atm_oam_net_security_groups }
226
227   # HA One Port (not part of Port Tuple)
228   vIPR_ATM_Ha_One_0_Port:
229     type: OS::Neutron::Port
230     properties:
231       name:
232         str_replace:
233           template: VM_NAME_PORT_1
234           params:
235             VM_NAME: { get_param: vipr_atm_name_0 }
236       network: { get_param: vipr_atm_ha_one_id }
237       fixed_ips: [ { "ip_address": { get_param: vipr_atm_ha_one_ip_0 } } ]
238       security_groups: { get_param: vipr_atm_ha_one_security_groups }
239
240   # HA Two Port (not part of Port Tuple)
241   vIPR_ATM_Ha_Two_0_Port:
242     type: OS::Neutron::Port
243     properties:
244       name:
245         str_replace:
246           template: VM_NAME_PORT_2
247           params:
248             VM_NAME: { get_param: vipr_atm_name_0 }
249       network: { get_param: vipr_atm_ha_two_id }
250       fixed_ips: [ { "ip_address": { get_param: vipr_atm_ha_two_ip_0 } } ]
251       security_groups: { get_param: vipr_atm_ha_two_security_groups }
252
253   # Valet Exclusivity Group
254   vIPR_ATM_Valet_EG_0:
255     type: ATT::Valet::GroupAssignment
256     properties:
257       group_name: { get_param: vipr_atm_valet_eg_0 }
258       group_type: exclusivity
259       level: host
260       resources:
261         - { get_resource: vIPR_ATM_Firewall }
262
263   # Create the VM and bind the five ports to it
264   # vIPR_ATM_Firewall_Cloud_Config:
265   #   type: OS::Heat::CloudConfig
266   #   properties:
267   #     cloud_config: 
268   #       password: ubuntu
269   #       chpasswd: { expire: False }
270   #       ssh_pwauth: True
271   #       manage_etc_hosts: true
272
273   vIPR_ATM_Firewall:
274     type: OS::Nova::Server
275     depends_on: 
276       - vIPR_ATM_Left_RII
277       - vIPR_ATM_Right_RII
278       - vIPR_ATM_OAM_0_Port
279       - vIPR_ATM_Ha_One_0_Port
280       - vIPR_ATM_Ha_Two_0_Port
281     properties:
282       name: { get_param: vipr_atm_name_0 }
283       image: { get_param: vipr_atm_image_name }
284       flavor: { get_param: vipr_atm_flavor_name }
285       availability_zone: { get_param: availability_zone_0 }
286       scheduler_hints:
287         group: { get_param: vipr_atm_server_group }
288       networks:
289         - port: { get_resource: vIPR_ATM_OAM_0_Port }
290         - port: { get_resource: vIPR_ATM_Ha_One_0_Port }
291         - port: { get_resource: vIPR_ATM_Ha_Two_0_Port }
292         - port: { get_resource: vIPR_ATM_Left_RVMI }
293         - port: { get_resource: vIPR_ATM_Right_RVMI }
294       metadata:
295         vnf_id: { get_param: vnf_id }
296         vnf_name: { get_param: vnf_name }
297         vf_module_id: { get_param: vf_module_id }
298 #      user_data_format: RAW
299 #      user_data: { get_resource: vIPR_ATM_Firewall_Cloud_Config }