push addional code
[sdc.git] / openecomp-be / lib / openecomp-sdc-translator-lib / openecomp-sdc-translator-core / src / test / resources / mock / services / heattotosca / contrail2serviceinstance / oneServiceInstance / inputfiles / lcp1_mss.oam-fw_si.yaml
1 heat_template_version: 2013-05-23
2
3 description: >
4   Version 2.0 10-14-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-OAM-FW-SI template that creates two OAM networks (direct and protected) with a scaled out firewall service between the two.
5
6 parameters:
7   service_policy_name:
8     type: string
9     description: Policy Name
10   service_policy_direction:
11     type: string
12     description: Direction of Policy
13   start_src_ports:
14     type: number
15     description: Start of src port
16   end_src_ports:
17     type: number
18     description: End of src port
19   start_dst_ports:
20     type: number
21     description: Start of dst port
22   end_dst_ports:
23     type: number
24     description: End of dst port
25   oam_mgmt_net_id:
26     type: string
27     description: Name of private network to be created
28   oam_protected_net_id:
29     type: string
30     description: Name of private network to be created
31   oam_direct_net_id:
32     type: string
33     description: Name of private network to be created
34   oam_hsl_net_id:
35     type: string
36     description: Name of private network to be created
37   st_name:
38     type: string
39     description: service template name or ID
40   st_type:
41     type: string
42     description: service type
43   st_image:
44     type: string
45     description: Name of the image
46   st_flavor:
47     type: string
48     description: Flavor
49   st_service_interface_type_list:
50     type: string
51     description: List of interface types
52   st_shared_ip_list:
53     type: string
54     description: List of shared ip enabled-disabled
55   st_static_routes_list:
56     type: string
57     description: List of static routes enabled-disabled
58   st_scaling:
59     type: string
60     description: Indicates whether service scaling is enabled
61   st_mode:
62     type: string
63     description: service mode
64   st_availability_zone_enable_flag:
65     type: string
66     description: service template availablity_zone feature enable flag
67   max_num_fw_instances:
68     type: number
69     description: maximum number of firewall instances for scaling
70   service_instance_name:
71     type: string
72     description: service instance name
73   availability_zone:
74     type: string
75     description: availability zone in form of Zone:Host
76   static_prefix_3_1:
77     type: string
78     description: prefix for static route
79   protected_net:
80     type: string
81
82 resources:
83   service_template:
84     type: OS::Contrail::ServiceTemplate
85     properties:
86       name: { get_param: st_name }
87       service_mode: { get_param: st_mode }
88       service_type: { get_param: st_type }
89       image_name: { get_param: st_image }
90       flavor: { get_param: st_flavor }
91       service_interface_type_list: { "Fn::Split" : [ ",", Ref: st_service_interface_type_list ] }
92       shared_ip_list: [ true, on, no, 0 ]
93       static_routes_list: { "Fn::Split" : [ ";", "n;false;false;false" ] }
94       service_scaling: { get_param: st_scaling }
95       availability_zone_enable: { get_param: st_availability_zone_enable_flag }
96       ordered_interfaces: true
97
98   service_instance:
99     type: OS::Contrail::ServiceInstance
100     properties:
101       name: { get_param: service_instance_name }
102       service_template: { get_resource:  service_template }
103       availability_zone: { get_param: availability_zone }
104       scale_out:
105           max_instances: 5
106       interface_list: [
107           {
108               virtual_network: {get_param: oam_mgmt_net_id}
109           },
110           {
111               virtual_network: {get_param: oam_protected_net_id}
112           },
113           {
114               virtual_network: {get_param: oam_direct_net_id},
115               static_routes: [
116                   { "prefix": {get_param: static_prefix_3_1} },
117               ],
118           },
119           {
120               virtual_network: {get_param: oam_hsl_net_id}
121           },
122       ]
123
124   service_policy:
125     type: OS::Contrail::NetworkPolicy
126     depends_on: [ service_instance ]
127     properties:
128       name: { get_param: service_policy_name }
129       entries:
130         policy_rule: [
131               {
132                 "direction": { get_param: service_policy_direction },
133                 "protocol": "any",
134                 "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}],
135                 "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}],
136                 "dst_addresses": [{ "virtual_network": {get_param: oam_direct_net_id}}],
137                 "action_list": {"apply_service": [{get_resource: service_instance}]},
138                 "src_addresses": [{ "virtual_network": {get_param: protected_net}}]
139               },
140         ]
141   service_policy_attach_direct_net:
142     type: OS::Contrail::AttachPolicy
143     depends_on: [ service_policy ]
144     properties:
145       network: { get_param: oam_direct_net_id }
146       policy: { get_attr: [service_policy, fq_name] }
147
148   service_policy_attach_protected_net:
149     type: OS::Contrail::AttachPolicy
150     depends_on: [ service_policy ]
151     properties:
152       network: { get_param: oam_protected_net_id }
153       policy: { get_attr: [service_policy, fq_name] }