1 heat_template_version: 2013-05-23
4 HOT template to creates two virtual network with one subnet each.
5 Creates a network policy for applying service between two VNs created before.
6 Attach the network policy to two virtual networks
10 description: Virtual network id
13 description: Direction of Policy
16 description: Start of src port
19 description: End of src port
22 description: Start of dst port
25 description: End of dst port
28 description: service to apply
31 description: Name of private network to be created
34 description: Private network address (CIDR notation)
35 private_net_1_gateway:
37 description: Private network gateway address
38 private_net_1_pool_start:
40 description: Start of private network IP address allocation pool
41 private_net_1_pool_end:
43 description: End of private network IP address allocation pool
46 description: Name of private network to be created
49 description: Private network address (CIDR notation)
50 private_net_2_gateway:
52 description: Private network gateway address
53 private_net_2_pool_start:
55 description: Start of private network IP address allocation pool
56 private_net_2_pool_end:
58 description: End of private network IP address allocation pool
62 type: OS::Neutron::Net
64 name: { get_param: private_net_1_name }
67 type: OS::Neutron::Net
69 name: { get_param: private_net_2_name }
72 type: OS::Neutron::Subnet
74 network_id: { get_resource: private_net_1 }
75 cidr: { get_param: private_net_1_cidr }
76 gateway_ip: { get_param: private_net_1_gateway }
78 - start: { get_param: private_net_1_pool_start }
79 end: { get_param: private_net_1_pool_end }
82 type: OS::Neutron::Subnet
84 network_id: { get_resource: private_net_2 }
85 cidr: { get_param: private_net_2_cidr }
86 gateway_ip: { get_param: private_net_2_gateway }
88 - start: { get_param: private_net_2_pool_start }
89 end: { get_param: private_net_2_pool_end }
92 type: OS::Contrail::NetworkPolicy
94 name: { get_param: policy_name }
98 "direction": { get_param: direction },
100 "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}],
101 "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}],
102 "dst_addresses": [{ "virtual_network": {get_resource: private_net_1}}],
103 "action_list": {"apply_service": [{get_param: apply_service}]},
104 "src_addresses": [{ "virtual_network": {get_resource: private_net_2}}]
107 private_policy_attach_net1:
108 type: OS::Contrail::AttachPolicy
110 network: { get_resource: private_net_1 }
111 policy: { get_attr: [private_policy, fq_name] }
113 private_policy_attach_net2:
114 type: OS::Contrail::AttachPolicy
116 network: { get_resource: private_net_2 }
117 policy: { get_attr: [private_policy, fq_name] }