-
Notifications
You must be signed in to change notification settings - Fork 0
/
rds_database.yaml
68 lines (62 loc) · 1.63 KB
/
rds_database.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
65
66
67
68
AWSTemplateFormatVersion: 2010-09-09
Description: Reusable Template for AWS RDS
# Define Parameters
Parameters:
MasterName:
NoEcho:
Type: String
Default: ""
Description: Enter Master Name
MasterPassword:
Type: String
Default: ""
Description: Enter Master Password
Subnet1:
Type: String
Default: ""
Description: This Subnet ID is for creating in US East (N. Virginia)us-east-1
Subnet2:
Type: String
Default: ""
Description: This Subnet ID is for creating in US East (N. Virginia)us-east-1
DataBaseName:
Type: String
Default: ""
Description: Enter the name of your DataBase
# Define Resources
Resources:
# RDS database subnet group
RDSSubnetGroup:
Type: AWS::RDS::DBSubnetGroup
Properties:
DBSubnetGroupDescription: This subnet group is for RDS DB
DBSubnetGroupName: WordPressSubGrp
SubnetIds:
- !Ref Subnet1
- !Ref Subnet2
# RDS database
MyRdsDb:
Type: AWS::RDS::DBInstance
Properties:
Engine: MariaDB
EngineVersion: 10.4.8
DBInstanceClass: db.t2.micro
DBName: !Ref DataBaseName
MasterUsername: !Ref MasterName
MasterUserPassword: !Ref MasterPassword
StorageType: gp2
AllocatedStorage: 20
MaxAllocatedStorage: 50
DBSubnetGroupName: !Ref RDSSubnetGroup
PubliclyAccessible: false
BackupRetentionPeriod: 0
DBInstanceIdentifier: rdsdemodbone
Port: 3306
# Define Outputs
Outputs:
DataBName:
Description: RDS Database Name
Value: !Ref MyRdsDb
DBSubnet:
Description: Database Subnet Group
Value: !Ref RDSSubnetGroup