VNF Software Version parameter added to CDS Heat templates
[demo.git] / heat / vLB_CDS / base_template.yaml
1 ##########################################################################
2 #
3 #==================LICENSE_START==========================================
4 #
5 #
6 # Copyright (c) 2019 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 common resources
28
29 ##############
30 #            #
31 # PARAMETERS #
32 #            #
33 ##############
34
35 parameters:
36
37   vlb_private_net_id:
38     type: string
39     label: vLoadBalancer private network name or ID
40     description: Private network that connects vLoadBalancer with vDNSs
41   pktgen_private_net_id:
42     type: string
43     label: vPacketGen private network name or ID
44     description: Private network that connects vLoadBalancer with vPacketGen
45   vlb_private_net_cidr:
46     type: string
47     label: vLoadBalancer private network CIDR
48     description: The CIDR of the vLoadBalancer private network
49   pktgen_private_net_cidr:
50     type: string
51     label: vPacketGen private network CIDR
52     description: The CIDR of the vPacketGen private network
53   vnf_id:
54     type: string
55     label: VNF ID
56     description: The VNF ID is provided by ONAP
57   vnf_name:
58     type: string
59     label: VNF NAME
60     description: The VNF NAME is provided by ONAP
61   vnf_software_version:
62     type: string
63     label: VNF software version
64     description: VNF software version
65     default: 1.0.0
66   vlb_0_int_pktgen_private_port_0_mac:
67     type: string
68     label: vLB MAC address
69     description: MAC address of the vLB used by the vPacketGen VM
70   vpg_0_int_pktgen_private_port_0_mac:
71     type: string
72     label: vPacketGen MAC address
73     description: MAC address of the vPacketGen used by the vLB VM
74   key_name:
75     type: string
76     label: Key pair name
77     description: Public/Private key pair name
78   pub_key:
79     type: string
80     label: Public key
81     description: Public key to be installed on the compute instance
82
83
84 #############
85 #           #
86 # RESOURCES #
87 #           #
88 #############
89
90 resources:
91
92   random-str_0:
93     type: OS::Heat::RandomString
94     properties:
95       length: 4
96
97   my_keypair_0:
98     type: OS::Nova::KeyPair
99     properties:
100       name:
101         str_replace:
102           template: vnfname_base_rand
103           params:
104             base: { get_param: key_name }
105             rand: { get_resource: random-str_0 }
106             vnfname: { get_param: vnf_name }
107       public_key: { get_param: pub_key }
108       save_private_key: false
109
110   # NETWORK_ROLE: private
111   int_private_network:
112     type: OS::Neutron::Net
113     properties:
114       name:
115         str_replace:
116           template: vnfname_privatenetid
117           params:
118             privatenetid: { get_param: vlb_private_net_id }
119             vnfname: { get_param: vnf_name }
120
121   # NETWORK_ROLE: private
122   int_private_subnet_0:
123     type: OS::Neutron::Subnet
124     properties:
125       name:
126         str_replace:
127           template: vnfname_privatenetid_subnet
128           params:
129             privatenetid: { get_param: vlb_private_net_id }
130             vnfname: { get_param: vnf_name }
131       network: { get_resource: int_private_network }
132       cidr: { get_param: vlb_private_net_cidr }
133
134   # NETWORK_ROLE: pktgen_private
135   int_pktgen_private_network:
136     type: OS::Neutron::Net
137     properties:
138       name:
139         str_replace:
140           template: vnfname_privatenetid
141           params:
142             privatenetid: { get_param: pktgen_private_net_id }
143             vnfname: { get_param: vnf_name }
144
145   # NETWORK_ROLE: pktgen_private
146   int_pktgen_private_subnet_0:
147     type: OS::Neutron::Subnet
148     properties:
149       name:
150         str_replace:
151           template: vnfname_privatenetid_subnet
152           params:
153             privatenetid: { get_param: pktgen_private_net_id }
154             vnfname: { get_param: vnf_name }
155       network: { get_resource: int_pktgen_private_network }
156       cidr: { get_param: pktgen_private_net_cidr }
157
158
159 outputs:
160   int_private_subnet_id:
161     value: { get_resource: int_private_subnet_0 }
162   int_private_net_id:
163     value: { get_resource: int_private_network }
164   int_pktgen_private_subnet_id:
165     value: { get_resource: int_pktgen_private_subnet_0 }
166   int_pktgen_private_net_id:
167     value: { get_resource: int_pktgen_private_network }
168   keypair:
169     value: { get_resource: my_keypair_0 }
170   vnf_id:
171     value: { get_param: vnf_id }
172   vnf_name:
173     value: { get_param: vnf_name }
174   vlb_0_mac_address:
175     value: { get_param: vlb_0_int_pktgen_private_port_0_mac }
176   vpg_0_mac_address:
177     value: { get_param: vpg_0_int_pktgen_private_port_0_mac }