-
Notifications
You must be signed in to change notification settings - Fork 1
/
cf_rds.json
106 lines (100 loc) · 2.23 KB
/
cf_rds.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
{
"Outputs": {
"RDSDatabaseConfig": {
"Description": "Properties associated with the RDS database instance",
"Value": {
"Fn::Join": [
",",
[
{
"Fn::GetAtt": [
"RDSDatabase",
"Endpoint.Address"
]
},
{
"Fn::GetAtt": [
"RDSDatabase",
"Endpoint.Port"
]
},
{ "Ref": "DBName" },
{ "Ref": "DBUser" },
{ "Ref": "DBPassword" }
]
]
}
},
"RDSPassSecurityGroup": {
"Description": "Security group assign to ec2 instance that need access to rds instance",
"Value": {
"Ref": "RDSPassSecurityGroup"
}
}
},
"Parameters": {
"DBUser": {
"Default": "admin",
"NoEcho": "true",
"Description": "The name of master user for the client DB Instance.",
"Type": "String",
"ConstraintDescription": "must begin with a letter and contain only alphanumeric characters"
},
"DBName": {
"Default": "mydb",
"NoEcho": "true",
"Description": "The DB Name of the RDS instance",
"Type": "String",
"ConstraintDescription": "must contain only alphanumeric characters"
},
"DBPassword": {
"NoEcho": "true",
"Description": "The master password for the DB instance.",
"Type": "String",
"ConstraintDescription": "must contain only alphanumeric characters"
}
},
"Resources": {
"RDSDBSecurityGroup": {
"Type": "AWS::RDS::DBSecurityGroup",
"Properties": {
"GroupDescription": "Enable database access to Beanstalk application",
"DBSecurityGroupIngress": {
"EC2SecurityGroupName": {
"Ref": "RDSPassSecurityGroup"
}
}
}
},
"RDSDatabase": {
"Type": "AWS::RDS::DBInstance",
"DeletionPolicy": "Delete",
"Properties": {
"MasterUsername": {
"Ref": "DBUser"
},
"DBSecurityGroups": [
{
"Ref": "RDSDBSecurityGroup"
}
],
"DBInstanceClass": "db.r5.large",
"AllocatedStorage": "5",
"EngineVersion": "13.4",
"DBName": {
"Ref": "DBName"
},
"MasterUserPassword": {
"Ref": "DBPassword"
},
"Engine": "postgres"
}
},
"RDSPassSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "SecurityGroup access RDS database."
}
}
}
}