Skip to content

Commit

Permalink
Read replica (#296)
Browse files Browse the repository at this point in the history
* adding read replica

* update instance
  • Loading branch information
kammerdiener authored Jun 29, 2023
1 parent 95f94d9 commit ca45f9a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions infra/prod/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,25 @@ const postgresql = new aws.rds.Instance(
{ protect: true }
);

const readOnlyReplica = new aws.rds.ReadReplica(
`scorer-db-read-replica`,
const readreplica0 = new aws.rds.Instance(
`scorer-db-read-0`,
{
sourceDbInstanceIdentifier: postgresql.id,
allocatedStorage: 20,
maxAllocatedStorage: 100,
engine: "postgres",
// engineVersion: "5.7",
instanceClass: "db.t3.medium",
dbName: dbName,
password: dbPassword,
username: dbUsername,
skipFinalSnapshot: true,
dbSubnetGroupName: dbSubnetGroup.id,
vpcSecurityGroupIds: [db_secgrp.id],
deletionProtection: true,
backupRetentionPeriod: 5,
replicateSourceDb: postgresql.id,
},
{ dependsOn: [postgresql] }
{ protect: true }
);

export const rdsEndpoint = postgresql.endpoint;
Expand Down

0 comments on commit ca45f9a

Please sign in to comment.