@@ -10,6 +10,9 @@ Parameters:
1010 SubnetId :
1111 Type : String
1212 Description : Redshift Subnet ID
13+ SubnetId2 :
14+ Type : String
15+ Description : Redshift Subnet ID
1316 Password :
1417 Type : String
1518 Description : Redshift Password
@@ -108,7 +111,7 @@ Resources:
108111 SubnetIds :
109112 - Ref : SubnetId
110113
111- RedshiftSecurityGroup :
114+ DatabaseSecurityGroup :
112115 Type : AWS::EC2::SecurityGroup
113116 Properties :
114117 VpcId : !Ref VpcId
@@ -117,7 +120,7 @@ Resources:
117120 Redshift :
118121 Type : AWS::Redshift::Cluster
119122 DependsOn :
120- - RedshiftSecurityGroup
123+ - DatabaseSecurityGroup
121124 - RedshiftSubnetGroup
122125 - RedshiftRole
123126 Properties :
@@ -127,7 +130,7 @@ Resources:
127130 NodeType : dc2.large
128131 ClusterType : single-node
129132 VpcSecurityGroupIds :
130- - !Ref RedshiftSecurityGroup
133+ - !Ref DatabaseSecurityGroup
131134 ClusterSubnetGroupName : !Ref RedshiftSubnetGroup
132135 PubliclyAccessible : true
133136 Port : 5439
@@ -152,6 +155,75 @@ Resources:
152155 Properties :
153156 LogGroupName : !Ref LogGroup
154157
158+ RdsSubnetGroup :
159+ Type : AWS::RDS::DBSubnetGroup
160+ Properties :
161+ DBSubnetGroupDescription : RDS Database Subnet Group
162+ SubnetIds :
163+ - Ref : SubnetId
164+ - Ref : SubnetId2
165+
166+ PostgresParameterGroup :
167+ Type : AWS::RDS::DBClusterParameterGroup
168+ Properties :
169+ Description : Postgres 10
170+ Family : aurora-postgresql10
171+ Parameters :
172+ apg_plan_mgmt.capture_plan_baselines : " off"
173+ AuroraClusterPostgres :
174+ Type : AWS::RDS::DBCluster
175+ Properties :
176+ Engine : aurora-postgresql
177+ DBClusterIdentifier : postgres-cluster-wrangler
178+ MasterUsername : test
179+ MasterUserPassword : !Ref Password
180+ BackupRetentionPeriod : 1
181+ DBSubnetGroupName : !Ref RdsSubnetGroup
182+ VpcSecurityGroupIds :
183+ - !Ref DatabaseSecurityGroup
184+ DBClusterParameterGroupName : !Ref PostgresParameterGroup
185+
186+ AuroraInstancePostgres :
187+ Type : AWS::RDS::DBInstance
188+ Properties :
189+ Engine : aurora-postgresql
190+ DBInstanceIdentifier : postgres-instance-wrangler
191+ DBClusterIdentifier : !Ref AuroraClusterPostgres
192+ DBInstanceClass : db.t3.medium
193+ DBSubnetGroupName : !Ref RdsSubnetGroup
194+ PubliclyAccessible : true
195+
196+ MysqlParameterGroup :
197+ Type : AWS::RDS::DBClusterParameterGroup
198+ Properties :
199+ Description : Mysql 5.7
200+ Family : aurora-mysql5.7
201+ Parameters :
202+ binlog_format : " MIXED"
203+
204+ AuroraClusterMysql :
205+ Type : AWS::RDS::DBCluster
206+ Properties :
207+ Engine : aurora-mysql
208+ DBClusterIdentifier : mysql-cluster-wrangler
209+ MasterUsername : test
210+ MasterUserPassword : !Ref Password
211+ BackupRetentionPeriod : 1
212+ DBSubnetGroupName : !Ref RdsSubnetGroup
213+ VpcSecurityGroupIds :
214+ - !Ref DatabaseSecurityGroup
215+ DBClusterParameterGroupName : !Ref MysqlParameterGroup
216+
217+ AuroraInstanceMysql :
218+ Type : AWS::RDS::DBInstance
219+ Properties :
220+ Engine : aurora-mysql
221+ DBInstanceIdentifier : mysql-instance-wrangler
222+ DBClusterIdentifier : !Ref AuroraClusterMysql
223+ DBInstanceClass : db.t3.medium
224+ DBSubnetGroupName : !Ref RdsSubnetGroup
225+ PubliclyAccessible : true
226+
155227Outputs :
156228 BucketName :
157229 Value : !Ref Bucket
@@ -183,3 +255,12 @@ Outputs:
183255 SubnetId :
184256 Value : !Ref SubnetId
185257 Description : Subnet ID
258+ SubnetId2 :
259+ Value : !Ref SubnetId2
260+ Description : Subnet ID 2
261+ PostgresAddress :
262+ Value : !GetAtt AuroraInstancePostgres.Endpoint.Address
263+ Description : Postgres Address
264+ MysqlAddress :
265+ Value : !GetAtt AuroraInstanceMysql.Endpoint.Address
266+ Description : Mysql Address
0 commit comments