-
Notifications
You must be signed in to change notification settings - Fork 34
/
rds.yaml
60 lines (53 loc) · 1.72 KB
/
rds.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
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
DatabaseSecurityGroup:
Description: Sets the security group to use for RDS database access
Type: AWS::EC2::SecurityGroup::Id
PrivateSubnet1:
Description: A reference to the private subnet in the 1st Availability Zone
Type: AWS::EC2::Subnet::Id
PrivateSubnet2:
Description: A reference to the private subnet in the 2nd Availability Zone
Type: AWS::EC2::Subnet::Id
DbPassword:
Description: The password to use for the database
Type: String
NoEcho: true
Resources:
PostgresSubnetGroup:
Type: AWS::RDS::DBSubnetGroup
Properties:
DBSubnetGroupDescription: Created from the RDS Management Console
SubnetIds:
- Ref: PrivateSubnet1
- Ref: PrivateSubnet2
PostgresService:
Type: AWS::RDS::DBInstance
Properties:
AllocatedStorage: '20'
AllowMajorVersionUpgrade: false
AutoMinorVersionUpgrade: true
DBInstanceClass: db.t2.medium
Port: '5432'
PubliclyAccessible: false
StorageType: gp2
BackupRetentionPeriod: '7'
MasterUsername: concordia
MasterUserPassword: !Ref DbPassword
PreferredBackupWindow: 03:47-04:17
PreferredMaintenanceWindow: sun:07:14-sun:07:44
DBName: concordia
Engine: postgres
EngineVersion: 9.6.6
LicenseModel: postgresql-license
DBSubnetGroupName:
Ref: PostgresSubnetGroup
VPCSecurityGroups:
- Ref: DatabaseSecurityGroup
Tags:
- Key: workload-type
Value: other
Outputs:
DatabaseHostName:
Description : "Hostname for the relational database service"
Value : !GetAtt PostgresService.Endpoint.Address