-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathprivate_network_with_router.yaml
64 lines (53 loc) · 1.67 KB
/
private_network_with_router.yaml
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
heat_template_version: 2021-04-16
description: >
This template creates an advanced networking environment, consisting of a
private network and router, ready for servers to join. The new private
network ID is given in the output.
parameters:
availability_zone:
type: string
description: The Nectar availability zone to launch in
public_network:
type: string
description: The Name or ID of the external network to attach the floating IP to
constraints:
- custom_constraint: neutron.network
resources:
my_network:
type: OS::Neutron::Net
properties:
name:
list_join: [ '-', [ { get_param: "OS::stack_name" }, 'network']]
my_subnet:
type: OS::Neutron::Subnet
properties:
name:
list_join: [ '-', [ { get_param: "OS::stack_name" }, 'subnet']]
dns_nameservers:
- 1.1.1.1
- 1.0.0.1
network: { get_resource: my_network }
ip_version: 4
cidr: 192.168.45.0/24
allocation_pools:
- { start: 192.168.45.2, end: 192.168.45.254 }
my_router:
type: OS::Neutron::Router
properties:
external_gateway_info: {"network": { get_param: public_network }}
name:
list_join: [ '-', [ { get_param: "OS::stack_name" }, 'router']]
my_router_gateway:
type: OS::Neutron::RouterGateway
properties:
router_id: { get_resource: my_router }
network_id: { get_param: public_network }
my_router_interface:
type: OS::Neutron::RouterInterface
properties:
router: { get_resource: my_router }
subnet: { get_resource: my_subnet }
outputs:
network_id:
description: Private network ID
value: { get_resource: my_network }