Skip to content

Commit

Permalink
feat(rds): deprecate OracleSE and OracleSE1 engine versions (#10241)
Browse files Browse the repository at this point in the history
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*
  • Loading branch information
njlynch authored Sep 9, 2020
1 parent 61865aa commit 562f891
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 69 deletions.
54 changes: 18 additions & 36 deletions packages/@aws-cdk/aws-rds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
},
Expand All @@ -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
Expand All @@ -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,
},
Expand All @@ -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: {
Expand All @@ -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
Expand All @@ -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',
Expand All @@ -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,
Expand Down Expand Up @@ -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: [
{
Expand Down
24 changes: 18 additions & 6 deletions packages/@aws-cdk/aws-rds/lib/instance-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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). */
Expand Down Expand Up @@ -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({
Expand All @@ -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({
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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);
}
Expand Down
41 changes: 21 additions & 20 deletions packages/@aws-cdk/aws-rds/test/integ.instance.lit.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -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",
Expand All @@ -413,7 +413,7 @@
]
}
],
"OptionGroupDescription": "Option group for oracle-se1 11.2"
"OptionGroupDescription": "Option group for oracle-se2 19"
}
},
"InstanceSubnetGroupF2CBA54F": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": [
Expand All @@ -980,7 +983,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters11aa2ce8971716ca7c8d28d472ab5e937131e78e136d0de8f4997fb11c4de847S3VersionKey68B7BF84"
"Ref": "AssetParameters74a1cab76f5603c5e27101cb3809d8745c50f708b0f4b497ed0910eb533d437bS3VersionKeyF33C73AF"
}
]
}
Expand All @@ -993,7 +996,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters11aa2ce8971716ca7c8d28d472ab5e937131e78e136d0de8f4997fb11c4de847S3VersionKey68B7BF84"
"Ref": "AssetParameters74a1cab76f5603c5e27101cb3809d8745c50f708b0f4b497ed0910eb533d437bS3VersionKeyF33C73AF"
}
]
}
Expand All @@ -1003,14 +1006,12 @@
]
}
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB",
"Arn"
]
},
"Runtime": "nodejs10.x"
}
},
"DependsOn": [
"LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB",
Expand Down Expand Up @@ -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\""
}
}
}
}
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ 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',
},
});

/// 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',
Expand All @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions packages/@aws-cdk/aws-rds/test/test.instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 562f891

Please sign in to comment.