From 05a8d545d27e1f6ef3fa93af502a6f0e98f2a04d Mon Sep 17 00:00:00 2001 From: Milton Reder Date: Tue, 4 Apr 2023 10:44:05 -0400 Subject: [PATCH 1/3] SQL-181 RDS template updates (#291) * SQL-181 update default engine to 14.3 with a valid instance type * SQL-181 add optional replica and pub/priv switch --- dev-resources/template/1_db.yml | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/dev-resources/template/1_db.yml b/dev-resources/template/1_db.yml index 2cab03bf3..f8e2f7d17 100644 --- a/dev-resources/template/1_db.yml +++ b/dev-resources/template/1_db.yml @@ -24,14 +24,28 @@ Parameters: DBEngineVersion: Description: PostgreSQL engine version on RDS Type: String - Default: "12.9" + Default: "14.3" AllowedValues: - "12.9" - "14.3" DBInstanceClass: Description: For provisioned aurora, the instance class to use Type: String - Default: "db.r4.large" + Default: "db.r5.large" + DBInstanceReplica: + Description: Whether or not to create a second DB instance for use as a read-replica + Type: String + AllowedValues: + - true + - false + Default: false + DBInstancePublic: + Description: Whether or not to allow public access to DB instances + Type: String + AllowedValues: + - true + - false + Default: false DBName: Description: PG Database name. Ignored if DBSnapshotIdentifier is provided Type: String @@ -70,6 +84,8 @@ Mappings: Conditions: DBProvisioned: !Equals [!Ref DBEngineMode, "provisioned"] + DBCreateReadReplica: + !And [Condition: DBProvisioned, !Equals [!Ref DBInstanceReplica, "true"]] DBSnapshotIdentifierProvided: !Not [!Equals [!Ref DBSnapshotIdentifier, ""]] @@ -131,7 +147,17 @@ Resources: Engine: aurora-postgresql EngineVersion: !Ref DBEngineVersion DBClusterIdentifier: !Ref DBCluster - PubliclyAccessible: false + PubliclyAccessible: !Ref DBInstancePublic + DBInstanceClass: !Ref DBInstanceClass + + DBInstance1: + Condition: DBCreateReadReplica + Type: AWS::RDS::DBInstance + Properties: + Engine: aurora-postgresql + EngineVersion: !Ref DBEngineVersion + DBClusterIdentifier: !Ref DBCluster + PubliclyAccessible: !Ref DBInstancePublic DBInstanceClass: !Ref DBInstanceClass Outputs: From 119ccc7eb0d0e2cd7ca8c91e66e655a343afb142 Mon Sep 17 00:00:00 2001 From: kelvinqian00 Date: Thu, 25 May 2023 09:51:46 -0400 Subject: [PATCH 2/3] Update SQLite version --- deps.edn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deps.edn b/deps.edn index fe8b21162..ec62b70fe 100644 --- a/deps.edn +++ b/deps.edn @@ -66,7 +66,7 @@ :aliases {:db-sqlite {:extra-paths ["src/db/sqlite"] - :extra-deps {org.xerial/sqlite-jdbc {:mvn/version "3.36.0"}}} + :extra-deps {org.xerial/sqlite-jdbc {:mvn/version "3.42.0.0"}}} :db-postgres {:extra-paths ["src/db/postgres"] :extra-deps {org.postgresql/postgresql {:mvn/version "42.5.1"} @@ -91,7 +91,7 @@ "src/test" "dev-resources"] :extra-deps {;; DB deps - org.xerial/sqlite-jdbc {:mvn/version "3.36.0"} + org.xerial/sqlite-jdbc {:mvn/version "3.42.0.0"} org.postgresql/postgresql {:mvn/version "42.5.1"} org.testcontainers/postgresql {:mvn/version "1.17.3"} com.kohlschutter.junixsocket/junixsocket-common From 9530da762e983bde309d5c18ca1f2dcf6529dab9 Mon Sep 17 00:00:00 2001 From: kelvinqian00 Date: Thu, 25 May 2023 09:51:54 -0400 Subject: [PATCH 3/3] Add PEM files to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 625763a83..e2bcc6dd0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ pom.xml pom.xml.asc *.jar *.class +*.pem /lib/ /classes/ /target/