aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/resources/mock/services/heattotosca/attValetGroupAssignment/groupNameParameter/inputfiles/vIPR-ATM-Base.yaml
blob: fd70465878f2d9d5f615991422b8c2a54f9c6156 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
heat_template_version: 2015-04-30

description: >
  HOT template to create the vIPR-ATM firwall service template and instance.
  This template creates the following
  - Two service virtual networks for each side (left and right) of the vIPR-ATM firewalls
  - Two virtual networks for high availability between the vIPR-ATM firewalls
  - A Contrail Service Template for the vIPR-ATM service
  - A Contrail Service Instance for the vIPR-ATM service

  The firewall virtual machines connected to these created networks and managed by the
  vIPR-ATM service instance will be created by the vIPR-ATM-Instance.yaml HOT template.

  Network Policy that includes the vIPR-ATM service instance will be created by client
  specific HOT templates or Contrail APIs. 

parameters:
  vipr_atm_service_left_ip_prefix:
    type: string
    constraints:
      - 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]?)$
        description: A valid IPv4 dot quad IP address.
    description: Left vIPR-ATM service network IP address prefix
  vipr_atm_service_left_ip_prefix_len:
    type: number
    constraints:
      - range: { min: 0, max: 32 }
        description: a valid IPv4 prefix value from 0 to 32.
    description: Left vIPR-ATM service network IP address prefix length

  vipr_atm_service_right_ip_prefix:
    type: string
    constraints:
      - 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]?)$
        description: A valid IPv4 dot quad IP address.
    description: Right vIPR-ATM service network IP address prefix
  vipr_atm_service_right_ip_prefix_len:
    type: number
    constraints:
      - range: { min: 0, max: 32 }
        description: a valid IPv4 prefix value from 0 to 32.
    description: Right vIPR-ATM service network IP address prefix length

  vipr_atm_ha_one_cidr:
    type: string
    constraints:
      - 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])$
        description: A valid IPv4 CIDR (dot quad IP address / previx value 0 to 32).
    description: vIPR-ATM private High Availability Network One IP address CIDR

  vipr_atm_ha_two_cidr:
    type: string
    constraints:
      - 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])$
        description: A valid IPv4 CIDR (dot quad IP address / previx value 0 to 32).
    description: vIPR-ATM private High Availability Network Two IP address CIDR

  vnf_id:
    type: string
    description: Unique ID for this VNF instance
  vnf_name:
    type: string
    description: Unique name for this VNF instance
  vf_module_id:
    type: string
    description: Unique ID for the VF Module instance

resources:
  vIPR_ATM_Service_Left:
    type: OS::ContrailV2::VirtualNetwork
    properties:
      name:
        str_replace:
          template: VNF_NAME_VIPR_ATM_SERVICE_LEFT_NETWORK
          params:
            VNF_NAME: { get_param: vnf_name }
      network_ipam_refs: ["default-domain:default-project:default-network-ipam"]
      network_ipam_refs_data:
        [{
        network_ipam_refs_data_ipam_subnets:
          [{
          network_ipam_refs_data_ipam_subnets_subnet:
            {
            network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
              {
              get_param: vipr_atm_service_left_ip_prefix
              },
            network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
              {
              get_param: vipr_atm_service_left_ip_prefix_len
              },
            },
          }]
        }]

  vIPR_ATM_Service_Right:
    type: OS::ContrailV2::VirtualNetwork
    properties:
      name:
        str_replace:
          template: VNF_NAME_VIPR_ATM_SERVICE_RIGHT_NETWORK
          params:
            VNF_NAME: { get_param: vnf_name }
      network_ipam_refs: ["default-domain:default-project:default-network-ipam"]
      network_ipam_refs_data:
        [{
        network_ipam_refs_data_ipam_subnets:
          [{
          network_ipam_refs_data_ipam_subnets_subnet:
            {
            network_ipam_refs_data_ipam_subnets_subnet_ip_prefix:
              {
              get_param: vipr_atm_service_right_ip_prefix
              },
            network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len:
              {
              get_param: vipr_atm_service_right_ip_prefix_len
              },
            },
          }]
        }]

  vIPR_ATM_Ha_One:
    type: OS::Neutron::Net
    properties:
      name:
        str_replace:
          template: VNF_NAME_VIPR_ATM_HA_ONE_NETWORK
          params:
            VNF_NAME: { get_param: vnf_name }

  vIPR_ATM_Ha_One_Subnet:
    type: OS::Neutron::Subnet
    depends_on: 
      - vIPR_ATM_Ha_One
    properties:
      name:
        str_replace:
          template: NET_NAME_SUBNET
          params:
            NET_NAME: { get_attr: [ vIPR_ATM_Ha_One, name ] }
      network: { get_resource: vIPR_ATM_Ha_One }
      cidr: { get_param: vipr_atm_ha_one_cidr }
      enable_dhcp: False
      gateway_ip: null

  vIPR_ATM_Ha_Two:
    type: OS::Neutron::Net
    properties:
      name:
        str_replace:
          template: VNF_NAME_VIPR_ATM_HA_TWO_NETWORK
          params:
            VNF_NAME: { get_param: vnf_name }

  vIPR_ATM_Ha_Two_Subnet:
    type: OS::Neutron::Subnet
    depends_on: 
      - vIPR_ATM_Ha_Two
    properties:
      name:
        str_replace:
          template: NET_NAME_SUBNET
          params:
            NET_NAME: { get_attr: [ vIPR_ATM_Ha_Two, name ] }
      network: { get_resource: vIPR_ATM_Ha_Two }
      cidr: { get_param: vipr_atm_ha_two_cidr }
      enable_dhcp: False
      gateway_ip: null

  vIPR_ATM_Service_Template:
    type: OS::ContrailV2::ServiceTemplate
    properties:
      name:
        str_replace:
          template: VNF_NAME_VIPR_ATM_SERVICE_TEMPLATE
          params:
            VNF_NAME: { get_param: vnf_name }
      service_template_properties:
        {
        service_template_properties_version: 2,
        service_template_properties_service_mode: transparent,
        service_template_properties_service_type: firewall,
        service_template_properties_service_virtualization_type: virtual-machine,
        service_template_properties_interface_type:
          [
          {
          service_template_properties_interface_type_service_interface_type: Left,
          service_template_properties_interface_type_shared_ip: True,
          },
          {
          service_template_properties_interface_type_service_interface_type: Right,
          service_template_properties_interface_type_shared_ip: True,
          }
          ],
        }
      domain: default-domain

  vIPR_ATM_Service_Instance:
    type: OS::ContrailV2::ServiceInstance
    depends_on: 
      - vIPR_ATM_Service_Left
      - vIPR_ATM_Service_Right
      - vIPR_ATM_Service_Template
    properties:
      name:
        str_replace:
          template: VNF_NAME_VIPR_ATM_SERVICE_INSTANCE
          params:
            VNF_NAME: { get_param: vnf_name }
      service_template_refs: [{ get_resource: vIPR_ATM_Service_Template }]
      service_instance_properties:
        {
        service_instance_properties_ha_mode: active-active,
        service_instance_properties_left_virtual_network: 
          {
          list_join: [':', { get_attr: [ vIPR_ATM_Service_Left, fq_name ] } ]
          },
        service_instance_properties_right_virtual_network: 
          {
          list_join: [':', { get_attr: [ vIPR_ATM_Service_Right, fq_name ] } ]
          },
        }
  
  # Management (OAM) Port Security Group to allow ingress SSH 
  vIPR_ATM_OAM_SG:
    type: OS::Neutron::SecurityGroup
    properties:
      name: 
        str_replace:
          template: VNF_NAME_VIPR_ATM_OAM_SG
          params:
            VNF_NAME: { get_param: vnf_name }
      rules:
        - remote_ip_prefix: 0.0.0.0/0
          protocol: tcp
          port_range_min: 22
          port_range_max: 22
        - remote_ip_prefix: 0.0.0.0/0
          protocol: tcp
          port_range_min: 443
          port_range_max: 443
        - remote_ip_prefix: 0.0.0.0/0
          protocol: tcp
          port_range_min: 3978
          port_range_max: 3978
        - remote_ip_prefix: 0.0.0.0/0
          protocol: icmp

  vIPR_ATM_HA_ONE_SG:
    type: OS::Neutron::SecurityGroup
    properties:
      name:
        str_replace:
          template: VNF_NAME_VIPR_ATM_HA_ONE_SG
          params:
            VNF_NAME: { get_param: vnf_name }
      rules:
        - remote_mode: remote_group_id

  vIPR_ATM_HA_TWO_SG:
    type: OS::Neutron::SecurityGroup
    properties:
      name:
        str_replace:
          template: VNF_NAME_VIPR_ATM_HA_TWO_SG
          params:
            VNF_NAME: { get_param: vnf_name }
      rules:
        - remote_mode: remote_group_id

  vIPR_ATM_Server_Group:
    type: OS::Nova::ServerGroup
    properties:
      name:
        str_replace:
          template: VNF_NAME_VIPR_ATM_SERVER_GROUP
          params:
            VNF_NAME: { get_param: vnf_name }
      policies: 
        - anti-affinity

outputs:
  vipr_atm_contrail_service_instance_fqdn:
    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.
    value: { list_join: [':', { get_attr: [ vIPR_ATM_Service_Instance, fq_name ] } ] }

  vipr_atm_service_left_fqdn:
    description: The FQDN for the vIPR-ATM Service Left network.
    value: { list_join: [':', { get_attr: [ vIPR_ATM_Service_Left, fq_name ] } ] }

  vipr_atm_service_right_fqdn:
    description: The FQDN for the vIPR-ATM Service Right network.
    value: { list_join: [':', { get_attr: [ vIPR_ATM_Service_Right, fq_name ] } ] }

  vipr_atm_ha_one_id:
    description: The UUID for the vIPR-ATM HA One network.
    value: { get_resource: vIPR_ATM_Ha_One }

  vipr_atm_ha_two_id:
    description: The UUID for the vIPR-ATM HA Two network.
    value: { get_resource: vIPR_ATM_Ha_Two }

  vipr_atm_oam_net_security_groups:
    description: The list of OpenStack Security Groups to appliy to the vIPR-ATM-Instance\'s OAM network.
    value: [ { get_resource: vIPR_ATM_OAM_SG } ]

  vipr_atm_ha_one_security_groups:
    description: The list of OpenStack Security Groups to appliy to the vIPR-ATM-Instance\'s HA One network.
    value: [ { get_resource: vIPR_ATM_HA_ONE_SG } ]

  vipr_atm_ha_two_security_groups:
    description: The list of OpenStack Security Groups to appliy to the vIPR-ATM-Instance\'s HA Two network.
    value: [ { get_resource: vIPR_ATM_HA_TWO_SG } ]

  vipr_atm_server_group:
    description: The UUID for the vIPR-ATM OpenStack Server Group
    value: { get_resource: vIPR_ATM_Server_Group }