forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
polardb.yml
244 lines (244 loc) · 6.8 KB
/
polardb.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
ROSTemplateFormatVersion: '2015-09-01'
Description: POLARDB DBCluster/Account/DBInstance/DBNodes/AccountPrivilege/DBClusterAccessWhiteList/DBClusterEndpointAddress
resource example
Parameters:
ZoneId:
Type: String
Description: Zone Id.
DBType:
Type: String
Description: |-
Database type, value:
MySQL
PostgreSQL
Oracle
Default: MySQL
DBVersion:
Type: String
Description: |-
The version of the database. Valid values:
MySQL: 5.6 or 8.0
PostgreSQL: 11
Oracle: 11
Default: '5.6'
DBNodeClass:
Type: String
Description: The node specifications of the cluster. For more information, see
Specifications and pricing.
Default: polar.mysql.x4.medium
VSwitchName:
Type: String
Default: mytest
VpcName:
Type: String
Default: mytest
AccountName:
Type: String
Description: The name of the database account to be used.
Default: mytest
AccountPassword:
Type: String
AccountPrivilege:
Type: String
Description: 'The permissions of the database account on the database. Valid values:
ReadWrite: has read and write permissions on the database. ReadOnly: has the
read-only permission on the database. DMLOnly: runs only data manipulation language
(DML) statements. DDLOnly: runs only data definition language (DDL) statements.
Default value: ReadWrite. Separate multiple permissions with a comma (,).'
Default: ReadWrite
ChangeAccountPrivilege:
Type: String
Description: 'The permissions of the database account on the database. Valid values:
ReadWrite: has read and write permissions on the database. ReadOnly: has the
read-only permission on the database. DMLOnly: runs only data manipulation language
(DML) statements. DDLOnly: runs only data definition language (DDL) statements.
Default value: ReadWrite. Separate multiple permissions with a comma (,).'
Default: ReadOnly
AccountType:
Type: String
Description: 'The type of the database account. Valid values: -Normal: standard
account. -Super: privileged account. Default value: Super. Currently, POLARDB
PostgreSQL and POLARDB compatible with Oracle do not support standard accounts.
You can create only one privileged account for an ApsaraDB for POLARDB cluster.'
Default: Normal
DBName:
Type: String
Description: |-
The name of the database to be created. The name must comply with the following rules:
It must start with a lowercase letter and consist of lowercase letters, digits, hyphens
(-), and underscores (_).
It must end with a letter or a digit. It can be up to 64 characters in length.
Default: mytest
Amount:
Type: Number
Description: Number of nodes to be added to cluster.
Default: 1
SecurityIps:
Type: String
Description: |-
The IP addresses to be added to the IP address whitelist group to be modified. Each
whitelist group can contain a maximum of 1,000 IP addresses. Separate multiple IP
addresses with a comma (,). The following two formats are supported:
IP address: for example, 10.23.12.24.
Classless inter-domain routing (CIDR) block: for example, 10.23.12.24/24, where the
suffix /24 indicates the number of bits for the prefix of the IP address. The suffix
ranges from 1 to 32.
Default: 0.0.0.0
NetType:
Type: String
Description: "The network type of the connection string. \nIf set to Public, ROS\
\ will create, modify and delete Public address for you.\nIf set to Private,\
\ ROS will only modify Private address for you.\nDefault to Public."
Default: Public
AllowedValues:
- Public
- Private
Resources:
VPC:
Type: ALIYUN::ECS::VPC
Properties:
VpcName:
Ref: VpcName
CidrBlock: 192.168.0.0/16
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: VPC
VSwitchName:
Ref: VSwitchName
CidrBlock: 192.168.10.0/24
DependsOn: VPC
DBCluster:
Type: ALIYUN::POLARDB::DBCluster
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: VPC
VSwitchId:
Ref: VSwitch
DBType:
Ref: DBType
ClusterNetworkType: VPC
DBVersion:
Ref: DBVersion
DBNodeClass:
Ref: DBNodeClass
PayType: Postpaid
Account:
Type: ALIYUN::POLARDB::Account
Properties:
DBClusterId:
Fn::GetAtt:
- DBCluster
- DBClusterId
AccountName:
Ref: AccountName
AccountPrivilege:
Ref: AccountPrivilege
AccountPassword:
Ref: AccountPassword
AccountType:
Ref: AccountType
DBInstance:
Type: ALIYUN::POLARDB::DBInstance
Properties:
DBClusterId:
Fn::GetAtt:
- DBCluster
- DBClusterId
CharacterSetName: utf8
AccountName:
Ref: AccountName
DBName:
Ref: DBName
DependsOn:
- Account
- DBCluster
DBNodes:
Type: ALIYUN::POLARDB::DBNodes
Properties:
DBClusterId:
Fn::GetAtt:
- DBCluster
- DBClusterId
Amount:
Ref: Amount
DependsOn:
- DBCluster
- DBInstance
AccountPrivilege1:
Type: ALIYUN::POLARDB::AccountPrivilege
Properties:
DBClusterId:
Fn::GetAtt:
- DBCluster
- DBClusterId
AccountPrivilege:
Ref: ChangeAccountPrivilege
DBName:
Ref: DBName
AccountName:
Ref: AccountName
DependsOn:
- DBNodes
DBClusterAccessWhiteList:
Type: ALIYUN::POLARDB::DBClusterAccessWhiteList
Properties:
DBClusterId:
Fn::GetAtt:
- DBCluster
- DBClusterId
SecurityIps:
Ref: SecurityIps
DependsOn:
- AccountPrivilege1
DBClusterEndpointAddress:
Type: ALIYUN::POLARDB::DBClusterEndpointAddress
Properties:
DBClusterId:
Fn::GetAtt:
- DBCluster
- DBClusterId
DBEndpointId:
Fn::GetAtt:
- DBCluster
- ClusterEndpointId
NetType:
Ref: NetType
DependsOn:
- AccountPrivilege1
Outputs:
DBClusterId:
Description: The ID of the ApsaraDB for POLARDB cluster.
Value:
Fn::GetAtt:
- DBCluster
- DBClusterId
DBNodeIds:
Description: The ID list of added cluster nodes.
Value:
Fn::GetAtt:
- DBNodes
- DBNodeIds
OrderIds:
Description: The order ID list of added cluster nodes.
Value:
Fn::GetAtt:
- DBNodes
- OrderIds
ConnectionString:
Description: The connection string of the endpoint address.
Value:
Fn::GetAtt:
- DBClusterEndpointAddress
- ConnectionString
Address:
Description: The details of the endpoint address.
Value:
Fn::GetAtt:
- DBClusterEndpointAddress
- Address