Skip to content

Commit

Permalink
chore(rds): support postgreSQL v14 (and Other) (aws#21581)
Browse files Browse the repository at this point in the history
fixes: aws#21454

Version 14 of aurora cluster is now supported. In addition, versions of Aurora that seem to be omitted have been added.
I found a lot of deprecated parameters, but I'm submitting them as a separate issue because it's a lot of work.

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
watany-dev authored and josephedward committed Aug 30, 2022
1 parent 66553a3 commit 1f062b9
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
28 changes: 28 additions & 0 deletions packages/@aws-cdk/aws-rds/lib/cluster-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ export class AuroraEngineVersion {
public static readonly VER_1_22_1_3 = AuroraEngineVersion.builtIn_5_6('1.22.1.3');
/** Version "5.6.mysql_aurora.1.22.2". */
public static readonly VER_1_22_2 = AuroraEngineVersion.builtIn_5_6('1.22.2');
/** Version "5.6.mysql_aurora.1.22.3". */
public static readonly VER_1_22_3 = AuroraEngineVersion.builtIn_5_6('1.22.3');
/** Version "5.6.mysql_aurora.1.22.4". */
public static readonly VER_1_22_4 = AuroraEngineVersion.builtIn_5_6('1.22.4');
/** Version "5.6.mysql_aurora.1.22.5". */
public static readonly VER_1_22_5 = AuroraEngineVersion.builtIn_5_6('1.22.5');

/**
* Create a new AuroraEngineVersion with an arbitrary version.
Expand Down Expand Up @@ -300,6 +306,8 @@ class AuroraClusterEngine extends MySqlClusterEngineBase {
/**
* The versions for the Aurora MySQL cluster engine
* (those returned by {@link DatabaseClusterEngine.auroraMysql}).
*
* https://docs.aws.amazon.com/AmazonRDS/latest/AuroraMySQLReleaseNotes/Welcome.html
*/
export class AuroraMysqlEngineVersion {
/** Version "5.7.12". */
Expand Down Expand Up @@ -338,12 +346,28 @@ export class AuroraMysqlEngineVersion {
public static readonly VER_2_07_1 = AuroraMysqlEngineVersion.builtIn_5_7('2.07.1');
/** Version "5.7.mysql_aurora.2.07.2". */
public static readonly VER_2_07_2 = AuroraMysqlEngineVersion.builtIn_5_7('2.07.2');
/** Version "5.7.mysql_aurora.2.07.3". */
public static readonly VER_2_07_3 = AuroraMysqlEngineVersion.builtIn_5_7('2.07.3');
/** Version "5.7.mysql_aurora.2.07.4". */
public static readonly VER_2_07_4 = AuroraMysqlEngineVersion.builtIn_5_7('2.07.4');
/** Version "5.7.mysql_aurora.2.07.5". */
public static readonly VER_2_07_5 = AuroraMysqlEngineVersion.builtIn_5_7('2.07.5');
/** Version "5.7.mysql_aurora.2.07.6". */
public static readonly VER_2_07_6 = AuroraMysqlEngineVersion.builtIn_5_7('2.07.6');
/** Version "5.7.mysql_aurora.2.07.7". */
public static readonly VER_2_07_7 = AuroraMysqlEngineVersion.builtIn_5_7('2.07.7');
/** Version "5.7.mysql_aurora.2.07.8". */
public static readonly VER_2_07_8 = AuroraMysqlEngineVersion.builtIn_5_7('2.07.8');
/** Version "5.7.mysql_aurora.2.08.0". */
public static readonly VER_2_08_0 = AuroraMysqlEngineVersion.builtIn_5_7('2.08.0');
/** Version "5.7.mysql_aurora.2.08.1". */
public static readonly VER_2_08_1 = AuroraMysqlEngineVersion.builtIn_5_7('2.08.1');
/** Version "5.7.mysql_aurora.2.08.2". */
public static readonly VER_2_08_2 = AuroraMysqlEngineVersion.builtIn_5_7('2.08.2');
/** Version "5.7.mysql_aurora.2.08.3". */
public static readonly VER_2_08_3 = AuroraMysqlEngineVersion.builtIn_5_7('2.08.3');
/** Version "5.7.mysql_aurora.2.08.4". */
public static readonly VER_2_08_4 = AuroraMysqlEngineVersion.builtIn_5_7('2.08.4');
/** Version "5.7.mysql_aurora.2.09.0". */
public static readonly VER_2_09_0 = AuroraMysqlEngineVersion.builtIn_5_7('2.09.0');
/** Version "5.7.mysql_aurora.2.09.1". */
Expand Down Expand Up @@ -459,6 +483,8 @@ export interface AuroraPostgresEngineFeatures {
/**
* The versions for the Aurora PostgreSQL cluster engine
* (those returned by {@link DatabaseClusterEngine.auroraPostgres}).
*
* https://docs.aws.amazon.com/AmazonRDS/latest/AuroraPostgreSQLReleaseNotes/AuroraPostgreSQL.Updates.html
*/
export class AuroraPostgresEngineVersion {
/** Version "9.6.8". */
Expand Down Expand Up @@ -545,6 +571,8 @@ export class AuroraPostgresEngineVersion {
public static readonly VER_13_6 = AuroraPostgresEngineVersion.of('13.6', '13', { s3Import: true, s3Export: true });
/** Version "13.7". */
public static readonly VER_13_7 = AuroraPostgresEngineVersion.of('13.7', '13', { s3Import: true, s3Export: true });
/** Version "14.3". */
public static readonly VER_14_3 = AuroraPostgresEngineVersion.of('14.3', '14', { s3Import: true, s3Export: true });

/**
* Create a new AuroraPostgresEngineVersion with an arbitrary version.
Expand Down
56 changes: 56 additions & 0 deletions packages/@aws-cdk/aws-rds/test/cluster-engine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ describe('cluster engine', () => {
'aurora-postgresql9.6');
expect(DatabaseClusterEngine.auroraPostgres({ version: AuroraPostgresEngineVersion.of('10.0', '10') }).parameterGroupFamily).toEqual(
'aurora-postgresql10');
expect(DatabaseClusterEngine.auroraPostgres({ version: AuroraPostgresEngineVersion.of('14.3', '14') }).parameterGroupFamily).toEqual(
'aurora-postgresql14');
});

test('supported log types', () => {
Expand All @@ -112,4 +114,58 @@ describe('cluster engine', () => {
expect(DatabaseClusterEngine.auroraMysql({ version: AuroraMysqlEngineVersion.VER_2_08_1 }).supportedLogTypes).toEqual(mysqlLogTypes);
expect(DatabaseClusterEngine.auroraPostgres({ version: AuroraPostgresEngineVersion.VER_9_6_9 }).supportedLogTypes).toEqual(['postgresql']);
});

test('cluster parameter group correctly determined for AURORA_POSTGRESQL 14 (and other) and given version', () => {
// GIVEN
const engine_VER_14_3 = DatabaseClusterEngine.auroraPostgres({
version: AuroraPostgresEngineVersion.VER_14_3,
});
const engine_ver_1_22_3 = DatabaseClusterEngine.aurora({
version: AuroraEngineVersion.VER_1_22_3,
});
const engine_ver_1_22_4 = DatabaseClusterEngine.aurora({
version: AuroraEngineVersion.VER_1_22_4,
});
const engine_ver_1_22_5 = DatabaseClusterEngine.aurora({
version: AuroraEngineVersion.VER_1_22_5,
});
const engine_ver_2_7_3 = DatabaseClusterEngine.auroraMysql({
version: AuroraMysqlEngineVersion.VER_2_07_3,
});
const engine_ver_2_7_4 = DatabaseClusterEngine.auroraMysql({
version: AuroraMysqlEngineVersion.VER_2_07_4,
});
const engine_ver_2_7_5 = DatabaseClusterEngine.auroraMysql({
version: AuroraMysqlEngineVersion.VER_2_07_5,
});
const engine_ver_2_7_6 = DatabaseClusterEngine.auroraMysql({
version: AuroraMysqlEngineVersion.VER_2_07_6,
});
const engine_ver_2_7_7 = DatabaseClusterEngine.auroraMysql({
version: AuroraMysqlEngineVersion.VER_2_07_7,
});
const engine_ver_2_7_8 = DatabaseClusterEngine.auroraMysql({
version: AuroraMysqlEngineVersion.VER_2_07_8,
});
const engine_ver_2_8_3 = DatabaseClusterEngine.auroraMysql({
version: AuroraMysqlEngineVersion.VER_2_08_3,
});
const engine_ver_2_8_4 = DatabaseClusterEngine.auroraMysql({
version: AuroraMysqlEngineVersion.VER_2_08_4,
});

// THEN
expect(engine_VER_14_3.parameterGroupFamily).toEqual('aurora-postgresql14');
expect(engine_ver_1_22_3.parameterGroupFamily).toEqual('aurora5.6');
expect(engine_ver_1_22_4.parameterGroupFamily).toEqual('aurora5.6');
expect(engine_ver_1_22_5.parameterGroupFamily).toEqual('aurora5.6');
expect(engine_ver_2_7_3.parameterGroupFamily).toEqual('aurora-mysql5.7');
expect(engine_ver_2_7_4.parameterGroupFamily).toEqual('aurora-mysql5.7');
expect(engine_ver_2_7_5.parameterGroupFamily).toEqual('aurora-mysql5.7');
expect(engine_ver_2_7_6.parameterGroupFamily).toEqual('aurora-mysql5.7');
expect(engine_ver_2_7_7.parameterGroupFamily).toEqual('aurora-mysql5.7');
expect(engine_ver_2_7_8.parameterGroupFamily).toEqual('aurora-mysql5.7');
expect(engine_ver_2_8_3.parameterGroupFamily).toEqual('aurora-mysql5.7');
expect(engine_ver_2_8_4.parameterGroupFamily).toEqual('aurora-mysql5.7');
});
});

0 comments on commit 1f062b9

Please sign in to comment.