1804fdda9d96abe02e389ec8a5e98d8f19b3bd44
[demo.git] / heat / vFW_NextGen / templates / base_template.yaml
1 ##########################################################################
2 #
3 #==================LICENSE_START==========================================
4 #
5 #
6 # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
7 #
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
11 #        http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 #==================LICENSE_END============================================
20 #
21 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 #
23 ##########################################################################
24
25 heat_template_version: 2013-05-23
26
27 description: Heat template that deploys a private network for ONAP VNFs
28
29 ##############
30 #            #
31 # PARAMETERS #
32 #            #
33 ##############
34
35 parameters:
36   unprotected_private_net_id:
37     type: string
38     label: Unprotected private network name or ID
39     description: Private network that connects vPacketGenerator with vFirewall
40   unprotected_private_subnet_id:
41     type: string
42     label: Unprotected private subnetwork name or ID
43     description: Private subnetwork of the protected network
44   unprotected_private_net_cidr:
45     type: string
46     label: Unprotected private network CIDR
47     description: The CIDR of the unprotected private network
48   protected_private_net_id:
49     type: string
50     label: Protected private network name or ID
51     description: Private network that connects vFirewall with vSink
52   protected_private_subnet_id:
53     type: string
54     label: Protected private subnetwork name or ID
55     description: Private subnetwork of the unprotected network
56   protected_private_net_cidr:
57     type: string
58     label: Protected private network CIDR
59     description: The CIDR of the protected private network
60   key_name:
61     type: string
62     label: Key pair name
63     description: Public/Private key pair name
64   pub_key:
65     type: string
66     label: Public key
67     description: Public key to be installed on the compute instance
68
69
70 #############
71 #           #
72 # RESOURCES #
73 #           #
74 #############
75
76 resources:
77   random-str:
78     type: OS::Heat::RandomString
79     properties:
80       length: 4
81
82   my_keypair:
83     type: OS::Nova::KeyPair
84     properties:
85       name:
86         str_replace:
87           template: base_rand
88           params:
89             base: { get_param: key_name }
90             rand: { get_resource: random-str }
91       public_key: { get_param: pub_key }
92       save_private_key: false
93
94   unprotected_private_network:
95     type: OS::Neutron::Net
96     properties:
97       name: { get_param: unprotected_private_net_id }
98
99   unprotected_private_subnet:
100     type: OS::Neutron::Subnet
101     properties:
102       name: { get_param: unprotected_private_subnet_id }
103       network_id: { get_resource: unprotected_private_network }
104       cidr: { get_param: unprotected_private_net_cidr }
105
106   protected_private_network:
107     type: OS::Neutron::Net
108     properties:
109       name: { get_param: protected_private_net_id }
110
111   protected_private_subnet:
112     type: OS::Neutron::Subnet
113     properties:
114       name: { get_param: protected_private_subnet_id }
115       network_id: { get_resource: protected_private_network }
116       cidr: { get_param: protected_private_net_cidr }