-
Notifications
You must be signed in to change notification settings - Fork 0
/
sc-rds-mariadb-ra.json
317 lines (317 loc) · 11.6 KB
/
sc-rds-mariadb-ra.json
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Service Catalog: RDS MariaDB Reference Architecture Template. This template builds an Amazon AWS RDS MariaDB master database instance(fdp-1oc5hp7eg).",
"Metadata": {
"AWS::CloudFormation::Interface": {
"ParameterGroups": [
{
"Label": {
"default": "Amazon RDS MariaDB Database Network Configuration"
},
"Parameters": [
"DBVPC",
"DBSecurityGroupName",
"DBSubnets",
"DBSubnetGroupName",
"DBInputCIDR"
]
},
{
"Label": {
"default": "Amazon RDS MariaDB Database Configuration"
},
"Parameters": [
"DBName",
"DBEngine",
"DBEngineVersion",
"DBInstanceClass",
"DBAllocatedStorage",
"DBBackupRetentionPeriod"
]
},
{
"Label": {
"default": "Amazon RDS MariaDB Database Access"
},
"Parameters": [
"DBMasterUsername",
"DBMasterUserPassword",
"DBPortNumber"
]
},
{
"Label": {
"default": "Amazon RDS MariaDB Database High Availability"
},
"Parameters": [
"MultiAZ"
]
}
]
}
},
"Parameters": {
"DBVPC": {
"Type": "AWS::EC2::VPC::Id",
"Description": "Select the VPC where the RDS database will be created",
"ConstraintDescription": "must be an existing VPC"
},
"DBInputCIDR":{
"Description": "CIDR to allow access to DB instances",
"Type": "String",
"AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
"ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
},
"DBSecurityGroupName": {
"Description": "The name of the security group to be created",
"Type": "String",
"MinLength": "1",
"MaxLength": "255",
"ConstraintDescription": "Cannot start with sg-. Up to 255 characters in length."
},
"DBSubnets": {
"Type": "List<AWS::EC2::Subnet::Id>",
"Description": "Select at least 2 subnets across 2 AZs to include in the database subnet group",
"ConstraintDescription": "must be an existing subnet"
},
"DBName": {
"Default": "mariadb",
"Description": "The name of the database to create when the DB instance is created. If this parameter is not specified, the default \"MariaDB\" database is created in the DB instance.",
"Type": "String",
"MinLength": "5",
"MaxLength": "63",
"AllowedPattern": "[a-zA-Z][a-zA-Z0-9]*",
"ConstraintDescription": "must begin with a letter and contain only alphanumeric characters."
},
"DBSubnetGroupName": {
"Description": "The name of the subnet group to be created for RDS MariaDB",
"Type": "String",
"MinLength": "1",
"MaxLength": "256",
"AllowedPattern": "[a-zA-Z][a-zA-Z0-9]*",
"ConstraintDescription": "must begin with a character"
},
"DBPortNumber": {
"Description": "The port number on which the database accepts connections. Valid range from 1150-65535.",
"Type": "Number",
"Default": "5432",
"MinValue": "1150",
"MaxValue": "65535",
"ConstraintDescription": "Valid values range from 1150-65535"
},
"DBMasterUsername": {
"Description": "The database admin account username",
"Type": "String",
"MinLength": "5",
"MaxLength": "16",
"AllowedPattern": "^[\\w]+$",
"ConstraintDescription": "Minimum 5 characters must begin with a letter and contain only alphanumeric and underscore characters."
},
"DBMasterUserPassword": {
"Description": "The password for the master user. The password can include any printable ASCII character except \"/\", \"\"\", or \"@\".",
"NoEcho": true,
"Type": "String",
"MinLength": "12",
"MaxLength": "41",
"AllowedPattern": "^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?\\d)(?=.*?(_|\\W))(?=.*?\\s)?.{8,}$",
"ConstraintDescription": "Minimum 12 characters, at least one of each of the following: uppercase, lowercase, number, and symbol character such as !@#$%^&*()<>[]{}|_+-=."
},
"DBBackupRetentionPeriod": {
"Description": "The number of days for which automated backups are retained. Allowed values 0-10. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.",
"Default": "1",
"Type": "Number",
"MinValue": "0",
"MaxValue": "10",
"ConstraintDescription": "must be a number between 0 and 10."
},
"DBAllocatedStorage": {
"Default": "20",
"Description": "General Purpose (SSD) storage (gp2). Must be an integer from 20 to 16384.",
"Type": "Number",
"MinValue": "20",
"MaxValue": "16384",
"ConstraintDescription": "Must be an integer from 20 to 16384."
},
"DBEngineVersion": {
"Description": "The database engine version",
"Type": "String",
"Default": "10.3.13",
"AllowedValues": [
"10.3.13",
"10.3.8",
"10.2.21",
"10.1.34",
"10.0.35"
]
},
"DBInstanceClass": {
"Description": "The database instance type",
"Type": "String",
"Default": "db.t2.small",
"AllowedValues": [
"db.t2.micro",
"db.t2.small",
"db.t2.medium",
"db.t2.large",
"db.t2.xlarge",
"db.t2.xlarge",
"db.m5.24xlarge",
"db.m5.12xlarge",
"db.m5.4xlarge",
"db.m5.2xlarge",
"db.m5.xlarge",
"db.m5.large",
"db.m4.large",
"db.m4.xlarge",
"db.m4.2xlarge",
"db.m4.4xlarge",
"db.m4.10xlarge",
"db.m4.16xlarge",
"db.m3.medium",
"db.m3.large",
"db.m3.xlarge",
"db.m3.2xlarge",
"db.r3.large",
"db.r3.xlarge",
"db.r3.2xlarge",
"db.r3.4xlarge",
"db.r3.8xlarge",
"db.r4.large",
"db.r4.xlarge",
"db.r4.2xlarge",
"db.r4.4xlarge",
"db.r4.8xlarge",
"db.r4.16xlarge"
],
"ConstraintDescription": "must select a valid database instance type."
},
"MultiAZ": {
"Description": "Multi-AZ master database",
"Type": "String",
"Default": "false",
"AllowedValues": [
"true",
"false"
],
"ConstraintDescription": "must be true or false."
}
},
"Resources": {
"DBSubnetGroup": {
"Type": "AWS::RDS::DBSubnetGroup",
"Properties": {
"DBSubnetGroupName": {
"Ref": "DBSubnetGroupName"
},
"DBSubnetGroupDescription": "MariaDB RDS Subnet Group",
"SubnetIds": { "Ref": "DBSubnets" }
}
},
"DBEC2SecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupName": {
"Ref": "DBSecurityGroupName"
},
"GroupDescription": "Open database for access",
"VpcId": {
"Ref": "DBVPC"
},
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": {
"Ref": "DBPortNumber"
},
"ToPort": {
"Ref": "DBPortNumber"
},
"CidrIp": {
"Ref": "DBInputCIDR"
}
}
]
}
},
"MasterDB": {
"Type": "AWS::RDS::DBInstance",
"Properties": {
"DBName": {
"Ref": "DBName"
},
"DBSubnetGroupName": {
"Ref": "DBSubnetGroupName"
},
"AllocatedStorage": {
"Ref": "DBAllocatedStorage"
},
"DBInstanceClass": {
"Ref": "DBInstanceClass"
},
"Engine": "mariadb",
"EngineVersion": {
"Ref": "DBEngineVersion"
},
"MasterUsername": {
"Ref": "DBMasterUsername"
},
"MasterUserPassword": {
"Ref": "DBMasterUserPassword"
},
"MultiAZ": {
"Ref": "MultiAZ"
},
"BackupRetentionPeriod": {
"Ref": "DBBackupRetentionPeriod"
},
"Tags": [
{
"Key": "Name",
"Value": "MariaDB Master Database"
}
],
"VPCSecurityGroups": [
{
"Fn::GetAtt": [
"DBEC2SecurityGroup",
"GroupId"
]
}
],
"StorageEncrypted": true
},
"DependsOn": "DBSubnetGroup",
"DeletionPolicy": "Snapshot"
}
},
"Outputs": {
"MasterJDBCConnectionString": {
"Description": "JDBC connection string for the master database",
"Value": {
"Fn::Join": [
"",
[
"jdbc:mariadb://",
{
"Fn::GetAtt": [
"MasterDB",
"Endpoint.Address"
]
},
":",
{
"Fn::GetAtt": [
"MasterDB",
"Endpoint.Port"
]
},
"/",
{
"Ref": "DBName"
}
]
]
}
}
}
}