From 7abe8fcc83c1734c48a105b6f249c3ea42c71493 Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Mon, 9 Sep 2024 18:30:22 +0900 Subject: [PATCH] chore(rds): support 10.11.9, 10.6.19, 10.5.26 for MariaDB (#31366) Add new minor versions. Ref: [Amazon RDS for MariaDB supports minors 10.11.9, 10.6.19, 10.5.26](https://aws.amazon.com/about-aws/whats-new/2024/09/amazon-rds-mariadb-minors-10/) ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-rds/lib/instance-engine.ts | 6 +++ .../aws-rds/test/instance-engine.test.ts | 54 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts b/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts index e0bfec6452b62..dbe3d17992280 100644 --- a/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts +++ b/packages/aws-cdk-lib/aws-rds/lib/instance-engine.ts @@ -494,6 +494,8 @@ export class MariaDbEngineVersion { public static readonly VER_10_5_24 = MariaDbEngineVersion.of('10.5.24', '10.5'); /** Version "10.5.25". */ public static readonly VER_10_5_25 = MariaDbEngineVersion.of('10.5.25', '10.5'); + /** Version "10.5.26". */ + public static readonly VER_10_5_26 = MariaDbEngineVersion.of('10.5.26', '10.5'); /** Version "10.6" (only a major version, without a specific minor version). */ public static readonly VER_10_6 = MariaDbEngineVersion.of('10.6', '10.6'); @@ -539,6 +541,8 @@ export class MariaDbEngineVersion { public static readonly VER_10_6_17 = MariaDbEngineVersion.of('10.6.17', '10.6'); /** Version "10.6.18". */ public static readonly VER_10_6_18 = MariaDbEngineVersion.of('10.6.18', '10.6'); + /** Version "10.6.19". */ + public static readonly VER_10_6_19 = MariaDbEngineVersion.of('10.6.19', '10.6'); /** Version "10.11" (only a major version, without a specific minor version). */ public static readonly VER_10_11 = MariaDbEngineVersion.of('10.11', '10.11'); @@ -552,6 +556,8 @@ export class MariaDbEngineVersion { public static readonly VER_10_11_7 = MariaDbEngineVersion.of('10.11.7', '10.11'); /** Version "10.11.8". */ public static readonly VER_10_11_8 = MariaDbEngineVersion.of('10.11.8', '10.11'); + /** Version "10.11.9". */ + public static readonly VER_10_11_9 = MariaDbEngineVersion.of('10.11.9', '10.11'); /** * Create a new MariaDbEngineVersion with an arbitrary version. diff --git a/packages/aws-cdk-lib/aws-rds/test/instance-engine.test.ts b/packages/aws-cdk-lib/aws-rds/test/instance-engine.test.ts index 86d2b8b2dc574..107ff52094086 100644 --- a/packages/aws-cdk-lib/aws-rds/test/instance-engine.test.ts +++ b/packages/aws-cdk-lib/aws-rds/test/instance-engine.test.ts @@ -1,4 +1,5 @@ import { Template } from '../../assertions'; +import * as ec2 from '../../aws-ec2'; import * as iam from '../../aws-iam'; import * as cdk from '../../core'; import * as rds from '../lib'; @@ -262,4 +263,57 @@ describe('instance engine', () => { expect(engineConfig.features?.s3Export).toEqual('s3Export'); }); }); + + describe('MariaDB engine version', () => { + test.each([ + ['10.4', rds.MariaDbEngineVersion.VER_10_4], + ['10.4.29', rds.MariaDbEngineVersion.VER_10_4_29], + ['10.4.30', rds.MariaDbEngineVersion.VER_10_4_30], + ['10.4.31', rds.MariaDbEngineVersion.VER_10_4_31], + ['10.4.32', rds.MariaDbEngineVersion.VER_10_4_32], + ['10.4.33', rds.MariaDbEngineVersion.VER_10_4_33], + ['10.4.34', rds.MariaDbEngineVersion.VER_10_4_34], + ['10.5', rds.MariaDbEngineVersion.VER_10_5], + ['10.5.20', rds.MariaDbEngineVersion.VER_10_5_20], + ['10.5.21', rds.MariaDbEngineVersion.VER_10_5_21], + ['10.5.22', rds.MariaDbEngineVersion.VER_10_5_22], + ['10.5.23', rds.MariaDbEngineVersion.VER_10_5_23], + ['10.5.24', rds.MariaDbEngineVersion.VER_10_5_24], + ['10.5.25', rds.MariaDbEngineVersion.VER_10_5_25], + ['10.5.26', rds.MariaDbEngineVersion.VER_10_5_26], + ['10.6', rds.MariaDbEngineVersion.VER_10_6], + ['10.6.13', rds.MariaDbEngineVersion.VER_10_6_13], + ['10.6.14', rds.MariaDbEngineVersion.VER_10_6_14], + ['10.6.15', rds.MariaDbEngineVersion.VER_10_6_15], + ['10.6.16', rds.MariaDbEngineVersion.VER_10_6_16], + ['10.6.17', rds.MariaDbEngineVersion.VER_10_6_17], + ['10.6.18', rds.MariaDbEngineVersion.VER_10_6_18], + ['10.6.19', rds.MariaDbEngineVersion.VER_10_6_19], + ['10.11', rds.MariaDbEngineVersion.VER_10_11], + ['10.11.4', rds.MariaDbEngineVersion.VER_10_11_4], + ['10.11.5', rds.MariaDbEngineVersion.VER_10_11_5], + ['10.11.6', rds.MariaDbEngineVersion.VER_10_11_6], + ['10.11.7', rds.MariaDbEngineVersion.VER_10_11_7], + ['10.11.8', rds.MariaDbEngineVersion.VER_10_11_8], + ['10.11.9', rds.MariaDbEngineVersion.VER_10_11_9], + ])('is passed correctly for %s', (engineVersion, version) => { + + // WHEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + + new rds.DatabaseInstance(stack, 'Instance', { + engine: rds.DatabaseInstanceEngine.mariaDb({ version }), + vpc, + }); + + // THEN + Template.fromStack(stack).hasResource('AWS::RDS::DBInstance', { + Properties: { + Engine: 'mariadb', + EngineVersion: engineVersion, + }, + }); + }); + }); });