From 562f8913dae7b77a1516a60cc1ff277ac42fb9e0 Mon Sep 17 00:00:00 2001 From: Nick Lynch Date: Wed, 9 Sep 2020 13:19:43 +0100 Subject: [PATCH] feat(rds): deprecate OracleSE and OracleSE1 engine versions (#10241) Oracle 11.x and the SE and SE1 engines are no longer supported by Oracle (and RDS). As of Sep 1, 2020, no new instances can be launched with these engines (with the license-included license type). Support for bring-your-own-license instances will be removed Oct 1. Also took the opportunity to remove deprecated usages of version-less engines from the README. See https://forums.aws.amazon.com/ann.jspa?annID=7341 for more details. fixes #9249 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-rds/README.md | 54 +++++++------------ .../@aws-cdk/aws-rds/lib/instance-engine.ts | 24 ++++++--- .../test/integ.instance.lit.expected.json | 41 +++++++------- .../aws-rds/test/integ.instance.lit.ts | 8 +-- .../@aws-cdk/aws-rds/test/test.instance.ts | 7 +-- 5 files changed, 65 insertions(+), 69 deletions(-) diff --git a/packages/@aws-cdk/aws-rds/README.md b/packages/@aws-cdk/aws-rds/README.md index 6c94f2349f18d..1a5d4165d7409 100644 --- a/packages/@aws-cdk/aws-rds/README.md +++ b/packages/@aws-cdk/aws-rds/README.md @@ -26,7 +26,7 @@ your instances will be launched privately or publicly: ```ts const cluster = new rds.DatabaseCluster(this, 'Database', { - engine: rds.DatabaseClusterEngine.AURORA, + engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_2_08_1 }), masterUser: { username: 'clusteradmin' }, @@ -41,22 +41,13 @@ const cluster = new rds.DatabaseCluster(this, 'Database', { }); ``` -To use a specific version of the engine -(which is recommended, in order to avoid surprise updates when RDS add support for a newer version of the engine), -use the static factory methods on `DatabaseClusterEngine`: - -```typescript -new rds.DatabaseCluster(this, 'Database', { - engine: rds.DatabaseClusterEngine.aurora({ - version: rds.AuroraEngineVersion.VER_1_17_9, // different version class for each engine type - }), - ... -}); -``` - If there isn't a constant for the exact version you want to use, all of the `Version` classes have a static `of` method that can be used to create an arbitrary version. +```ts +const customEngineVersion = rds.AuroraMysqlEngineVersion.of('5.7.mysql_aurora.2.08.1'); +``` + By default, the master password will be generated and stored in AWS Secrets Manager with auto-generated description. Your cluster will be empty by default. To add a default database upon construction, specify the @@ -65,8 +56,8 @@ Your cluster will be empty by default. To add a default database upon constructi Use `DatabaseClusterFromSnapshot` to create a cluster from a snapshot: ```ts -new DatabaseClusterFromSnapshot(stack, 'Database', { - engine: DatabaseClusterEngine.aurora({ version: AuroraEngineVersion.VER_1_22_2 }), +new rds.DatabaseClusterFromSnapshot(stack, 'Database', { + engine: rds.DatabaseClusterEngine.aurora({ version: rds.AuroraEngineVersion.VER_1_22_2 }), instanceProps: { vpc, }, @@ -82,9 +73,9 @@ your instances will be launched privately or publicly: ```ts const instance = new rds.DatabaseInstance(this, 'Instance', { - engine: rds.DatabaseInstanceEngine.ORACLE_SE1, + engine: rds.DatabaseInstanceEngine.oracleSe2({ version: rds.OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }), // optional, defaults to m5.large - instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), + instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL), masterUsername: 'syscdk', vpc, vpcSubnets: { @@ -93,23 +84,14 @@ const instance = new rds.DatabaseInstance(this, 'Instance', { }); ``` -By default, the master password will be generated and stored in AWS Secrets Manager. - -To use a specific version of the engine -(which is recommended, in order to avoid surprise updates when RDS add support for a newer version of the engine), -use the static factory methods on `DatabaseInstanceEngine`: +If there isn't a constant for the exact engine version you want to use, +all of the `Version` classes have a static `of` method that can be used to create an arbitrary version. -```typescript -const instance = new rds.DatabaseInstance(this, 'Instance', { - engine: rds.DatabaseInstanceEngine.oracleSe2({ - version: rds.OracleEngineVersion.VER_19, // different version class for each engine type - }), - ... -}); +```ts +const customEngineVersion = rds.OracleEngineVersion.of('19.0.0.0.ru-2020-04.rur-2020-04.r1', '19'); ``` -If there isn't a constant for the exact version you want to use, -all of the `Version` classes have a static `of` method that can be used to create an arbitrary version. +By default, the master password will be generated and stored in AWS Secrets Manager. To use the storage auto scaling option of RDS you can specify the maximum allocated storage. This is the upper limit to which RDS can automatically scale the storage. More info can be found @@ -118,7 +100,7 @@ Example for max storage configuration: ```ts const instance = new rds.DatabaseInstance(this, 'Instance', { - engine: rds.DatabaseInstanceEngine.ORACLE_SE1, + engine: rds.DatabaseInstanceEngine.postgres({ version: rds.PostgresEngineVersion.VER_12_3 }), // optional, defaults to m5.large instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'syscdk', @@ -133,7 +115,7 @@ a source database respectively: ```ts new rds.DatabaseInstanceFromSnapshot(stack, 'Instance', { snapshotIdentifier: 'my-snapshot', - engine: rds.DatabaseInstanceEngine.POSTGRES, + engine: rds.DatabaseInstanceEngine.postgres({ version: rds.PostgresEngineVersion.VER_12_3 }), // optional, defaults to m5.large instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.LARGE), vpc, @@ -381,8 +363,8 @@ that are available for a particular Amazon RDS DB instance. const vpc: ec2.IVpc = ...; const securityGroup: ec2.ISecurityGroup = ...; new rds.OptionGroup(stack, 'Options', { - engine: DatabaseInstanceEngine.oracleSe({ - version: OracleLegacyEngineVersion.VER_11_2, + engine: rds.DatabaseInstanceEngine.oracleSe2({ + version: rds.OracleEngineVersion.VER_19, }), configurations: [ { diff --git a/packages/@aws-cdk/aws-rds/lib/instance-engine.ts b/packages/@aws-cdk/aws-rds/lib/instance-engine.ts index df715c9e0387a..5c0062aba2771 100644 --- a/packages/@aws-cdk/aws-rds/lib/instance-engine.ts +++ b/packages/@aws-cdk/aws-rds/lib/instance-engine.ts @@ -507,6 +507,8 @@ class PostgresInstanceEngine extends InstanceEngineBase { * (those returned by {@link DatabaseInstanceEngine.oracleSe} * and {@link DatabaseInstanceEngine.oracleSe1}). * Note: RDS will stop allowing creating new databases with this version in August 2020. + * + * @deprecated instances can no longer be created with these engine versions. See https://forums.aws.amazon.com/ann.jspa?annID=7341 */ export class OracleLegacyEngineVersion { /** Version "11.2" (only a major version, without a specific minor version). */ @@ -710,12 +712,15 @@ interface OracleInstanceEngineProps { /** * Properties for Oracle Standard Edition instance engines. * Used in {@link DatabaseInstanceEngine.oracleSe}. + * + * @deprecated instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 */ export interface OracleSeInstanceEngineProps { /** The exact version of the engine to use. */ readonly version: OracleLegacyEngineVersion; } +/** @deprecated instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 */ class OracleSeInstanceEngine extends OracleInstanceEngineBase { constructor(version?: OracleLegacyEngineVersion) { super({ @@ -735,12 +740,15 @@ class OracleSeInstanceEngine extends OracleInstanceEngineBase { /** * Properties for Oracle Standard Edition 1 instance engines. * Used in {@link DatabaseInstanceEngine.oracleSe1}. + * + * @deprecated instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 */ export interface OracleSe1InstanceEngineProps { /** The exact version of the engine to use. */ readonly version: OracleLegacyEngineVersion; } +/** @deprecated instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 */ class OracleSe1InstanceEngine extends OracleInstanceEngineBase { constructor(version?: OracleLegacyEngineVersion) { super({ @@ -1033,16 +1041,14 @@ export class DatabaseInstanceEngine { /** * The unversioned 'oracle-se1' instance engine. * - * @deprecated using unversioned engines is an availability risk. - * We recommend using versioned engines created using the {@link oracleSe1()} method + * @deprecated instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 */ public static readonly ORACLE_SE1: IInstanceEngine = new OracleSe1InstanceEngine(); /** * The unversioned 'oracle-se' instance engine. * - * @deprecated using unversioned engines is an availability risk. - * We recommend using versioned engines created using the {@link oracleSe()} method + * @deprecated instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 */ public static readonly ORACLE_SE: IInstanceEngine = new OracleSeInstanceEngine(); @@ -1101,12 +1107,18 @@ export class DatabaseInstanceEngine { return new PostgresInstanceEngine(props.version); } - /** Creates a new Oracle Standard Edition instance engine. */ + /** + * Creates a new Oracle Standard Edition instance engine. + * @deprecated instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 + */ public static oracleSe(props: OracleSeInstanceEngineProps): IInstanceEngine { return new OracleSeInstanceEngine(props.version); } - /** Creates a new Oracle Standard Edition 1 instance engine. */ + /** + * Creates a new Oracle Standard Edition 1 instance engine. + * @deprecated instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 + */ public static oracleSe1(props: OracleSe1InstanceEngineProps): IInstanceEngine { return new OracleSe1InstanceEngine(props.version); } diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json index 53c8c03e0f283..478b874b4d079 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json @@ -359,8 +359,8 @@ "ParameterGroup5E32DECB": { "Type": "AWS::RDS::DBParameterGroup", "Properties": { - "Description": "Parameter group for oracle-se1-11.2", - "Family": "oracle-se1-11.2", + "Description": "Parameter group for oracle-se2-19", + "Family": "oracle-se2-19", "Parameters": { "open_cursors": "2500" } @@ -394,11 +394,11 @@ "OptionGroupACA43DC1": { "Type": "AWS::RDS::OptionGroup", "Properties": { - "EngineName": "oracle-se1", - "MajorEngineVersion": "11.2", + "EngineName": "oracle-se2", + "MajorEngineVersion": "19", "OptionConfigurations": [ { - "OptionName": "XMLDB" + "OptionName": "LOCATOR" }, { "OptionName": "OEM", @@ -413,7 +413,7 @@ ] } ], - "OptionGroupDescription": "Option group for oracle-se1 11.2" + "OptionGroupDescription": "Option group for oracle-se2 19" } }, "InstanceSubnetGroupF2CBA54F": { @@ -644,7 +644,8 @@ "listener" ], "EnablePerformanceInsights": true, - "Engine": "oracle-se1", + "Engine": "oracle-se2", + "EngineVersion": "19.0.0.0.ru-2020-04.rur-2020-04.r1", "Iops": 1000, "LicenseModel": "bring-your-own-license", "MasterUsername": { @@ -965,9 +966,11 @@ "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A": { "Type": "AWS::Lambda::Function", "Properties": { + "Handler": "index.handler", + "Runtime": "nodejs10.x", "Code": { "S3Bucket": { - "Ref": "AssetParameters11aa2ce8971716ca7c8d28d472ab5e937131e78e136d0de8f4997fb11c4de847S3Bucket46EF559D" + "Ref": "AssetParameters74a1cab76f5603c5e27101cb3809d8745c50f708b0f4b497ed0910eb533d437bS3Bucket48EF98C9" }, "S3Key": { "Fn::Join": [ @@ -980,7 +983,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters11aa2ce8971716ca7c8d28d472ab5e937131e78e136d0de8f4997fb11c4de847S3VersionKey68B7BF84" + "Ref": "AssetParameters74a1cab76f5603c5e27101cb3809d8745c50f708b0f4b497ed0910eb533d437bS3VersionKeyF33C73AF" } ] } @@ -993,7 +996,7 @@ "Fn::Split": [ "||", { - "Ref": "AssetParameters11aa2ce8971716ca7c8d28d472ab5e937131e78e136d0de8f4997fb11c4de847S3VersionKey68B7BF84" + "Ref": "AssetParameters74a1cab76f5603c5e27101cb3809d8745c50f708b0f4b497ed0910eb533d437bS3VersionKeyF33C73AF" } ] } @@ -1003,14 +1006,12 @@ ] } }, - "Handler": "index.handler", "Role": { "Fn::GetAtt": [ "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", "Arn" ] - }, - "Runtime": "nodejs10.x" + } }, "DependsOn": [ "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", @@ -1108,17 +1109,17 @@ } }, "Parameters": { - "AssetParameters11aa2ce8971716ca7c8d28d472ab5e937131e78e136d0de8f4997fb11c4de847S3Bucket46EF559D": { + "AssetParameters74a1cab76f5603c5e27101cb3809d8745c50f708b0f4b497ed0910eb533d437bS3Bucket48EF98C9": { "Type": "String", - "Description": "S3 bucket for asset \"11aa2ce8971716ca7c8d28d472ab5e937131e78e136d0de8f4997fb11c4de847\"" + "Description": "S3 bucket for asset \"74a1cab76f5603c5e27101cb3809d8745c50f708b0f4b497ed0910eb533d437b\"" }, - "AssetParameters11aa2ce8971716ca7c8d28d472ab5e937131e78e136d0de8f4997fb11c4de847S3VersionKey68B7BF84": { + "AssetParameters74a1cab76f5603c5e27101cb3809d8745c50f708b0f4b497ed0910eb533d437bS3VersionKeyF33C73AF": { "Type": "String", - "Description": "S3 key for asset version \"11aa2ce8971716ca7c8d28d472ab5e937131e78e136d0de8f4997fb11c4de847\"" + "Description": "S3 key for asset version \"74a1cab76f5603c5e27101cb3809d8745c50f708b0f4b497ed0910eb533d437b\"" }, - "AssetParameters11aa2ce8971716ca7c8d28d472ab5e937131e78e136d0de8f4997fb11c4de847ArtifactHash27BA7171": { + "AssetParameters74a1cab76f5603c5e27101cb3809d8745c50f708b0f4b497ed0910eb533d437bArtifactHash976CF1BD": { "Type": "String", - "Description": "Artifact hash for asset \"11aa2ce8971716ca7c8d28d472ab5e937131e78e136d0de8f4997fb11c4de847\"" + "Description": "Artifact hash for asset \"74a1cab76f5603c5e27101cb3809d8745c50f708b0f4b497ed0910eb533d437b\"" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts index f98c65a0950f3..7f36806c35230 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts @@ -18,7 +18,7 @@ class DatabaseInstanceStack extends cdk.Stack { /// !show // Set open cursors with parameter group const parameterGroup = new rds.ParameterGroup(this, 'ParameterGroup', { - engine: rds.DatabaseInstanceEngine.ORACLE_SE1, + engine: rds.DatabaseInstanceEngine.oracleSe2({ version: rds.OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }), parameters: { open_cursors: '2500', }, @@ -26,10 +26,10 @@ class DatabaseInstanceStack extends cdk.Stack { /// Add XMLDB and OEM with option group const optionGroup = new rds.OptionGroup(this, 'OptionGroup', { - engine: rds.DatabaseInstanceEngine.ORACLE_SE1, + engine: rds.DatabaseInstanceEngine.oracleSe2({ version: rds.OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }), configurations: [ { - name: 'XMLDB', + name: 'LOCATOR', }, { name: 'OEM', @@ -44,7 +44,7 @@ class DatabaseInstanceStack extends cdk.Stack { // Database instance with production values const instance = new rds.DatabaseInstance(this, 'Instance', { - engine: rds.DatabaseInstanceEngine.ORACLE_SE1, + engine: rds.DatabaseInstanceEngine.oracleSe2({ version: rds.OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }), licenseModel: rds.LicenseModel.BRING_YOUR_OWN_LICENSE, instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.MEDIUM), multiAz: true, diff --git a/packages/@aws-cdk/aws-rds/test/test.instance.ts b/packages/@aws-cdk/aws-rds/test/test.instance.ts index 3ba4d67cb1b93..074bb1438b3e2 100644 --- a/packages/@aws-cdk/aws-rds/test/test.instance.ts +++ b/packages/@aws-cdk/aws-rds/test/test.instance.ts @@ -22,7 +22,7 @@ export = { 'create a DB instance'(test: Test) { // WHEN new rds.DatabaseInstance(stack, 'Instance', { - engine: rds.DatabaseInstanceEngine.ORACLE_SE1, + engine: rds.DatabaseInstanceEngine.oracleSe2({ version: rds.OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }), licenseModel: rds.LicenseModel.BRING_YOUR_OWN_LICENSE, instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MEDIUM), multiAz: true, @@ -64,7 +64,8 @@ export = { 'listener', ], EnablePerformanceInsights: true, - Engine: 'oracle-se1', + Engine: 'oracle-se2', + EngineVersion: '19.0.0.0.ru-2020-04.rur-2020-04.r1', Iops: 1000, LicenseModel: 'bring-your-own-license', MasterUsername: { @@ -197,7 +198,7 @@ export = { 'instance with option and parameter group'(test: Test) { const optionGroup = new rds.OptionGroup(stack, 'OptionGroup', { - engine: rds.DatabaseInstanceEngine.ORACLE_SE1, + engine: rds.DatabaseInstanceEngine.oracleSe2({ version: rds.OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }), configurations: [ { name: 'XMLDB',