-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rds): introduce type-safe engine versions #9016
Conversation
Still missing:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this pattern, is there any equivalent of specifying major version, but leaving the minor version to latest/recommended? For example, can I say: "create an Aurora cluster with v2" or "MySQL 5.7" and let the CDK figure out the details?
Not currently, but I really like the idea! What API would you see for this? Something like |
cc @jogold if you'd like to weigh in here, I would love to use your expertise! |
bc561f1
to
5736be9
Compare
Done for the instance engines (unfortunately, there is no such option for cluster engines, at least that I know of). |
@njlynch @shivlaks @jogold this is ready for another round of reviews. I also have one open question, that I want your opinion on. I wonder what should be the behavior for engines without a version specified, with respect to their For example, let's take the I wonder if we should guard customers from this potential mistake, and simply say that engines without a version don't have a I would love to hear your thoughts! |
*/ | ||
export class OracleEngineVersion { | ||
/** Version "11.2" (only a major version, without a specific minor version). */ | ||
public static readonly VER_11_2 = OracleEngineVersion.of('11.2', '11.2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://forums.aws.amazon.com/ann.jspa?annID=7341
Amazon RDS for Oracle will end the support for Oracle Database version 11.2.0.4 Standard Edition 1 (SE1) for license-included (LI) on October 31, 2020. For bring-your-own-license (BYOL), RDS for Oracle will end the support for Oracle Database version 11.2.0.4 for all editions on December 31, 2020.
Starting on August 1, 2020, Amazon RDS for Oracle will disable the ability to create new DB instances using 11.2.0.4 on SE1 with LI.
You can drop all the VER_11_xxx
(and the ORACLE_SE
and ORACLE_SE1
because they only allow v11 instances).
This also means that for Oracle you maybe need specific versions lists per engine (ee, se2).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. The way I did it, is I split the existing one class into 2. OracleLegacyEngineVersion
and OracleEngineVersion
. The first one has all of the 11.2
versions, and is used in oracleSe
and oracleSe1
methods. The other one has all version 12.1
and up, and is used for oracleSe2
and oracleEe
methods.
Let me know if this makes sense @jogold !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
I personally think that the CDK should not let users create an instance/cluster without specifying a version. Making the version required will force users to think about it vs forget to specify it by mistake with potentially bad consequences (+ RDS deploy times are really long so this mistake can take hours to notice/fix). A RDS instance/cluster is a costly piece of cloud infrastructure (and a complex one) and users (usually experienced ones) creating those instances/clusters should be forced to "design" before deploy. |
@skinny85 - I also share your concern for the versioning. In this example, if version We had a similar problem in I'd be inclined to go towards making it required for now and relaxing that condition at a later time (if it makes sense to). |
OK. How about this?
|
5736be9
to
07d38da
Compare
Sounds good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* The versions for the legacy Oracle instance engines | ||
* (those returned by {@link DatabaseInstanceEngine.oracleSe} | ||
* and {@link DatabaseInstanceEngine.oracleSe1}). | ||
* Note: RDS will stop allowing creating new databases with this version in August 2020. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth pushing this only to deprecate it in one month?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. People still might have CDK code with existing databases using it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They can use the of()
then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with these changes. thanks for keeping with it and getting it here!!!
07d38da
to
2f04ec7
Compare
engine: rds.DatabaseInstanceEngine.oracleSe1({ | ||
version: '11.2', | ||
}), | ||
engine: rds.DatabaseInstanceEngine.ORACLE_SE1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change to SE2 here also because this integ test will soon not deploy anymore, the instance should also be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I'll do that in a follow-up PR (probably when we deprecate oracleSe
and oracleSe1
).
2f04ec7
to
a6246b5
Compare
Change engine versions, for boh cluster and instance engines, from strings to strongly-typed classes with static constants representing common versions. Fixes aws#6532 BREAKING CHANGE: the property 'version' has been changed from string to an engine-specific version class; use VersionClass.of() if you need to create a specific version of an engine from a string * **rds**: the property engineVersion in IClusterEngine changed from a string to EngineVersion * **rds**: the property engineVersion in IInstanceEngine changed from a string to EngineVersion * **rds**: the property parameterGroupFamily in IClusterEngine changed from required to optional * **rds**: the property parameterGroupFamily in IInstanceEngine changed from required to optional
a6246b5
to
9eddbca
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Change engine versions, for boh cluster and instance engines, from strings to strongly-typed classes with static constants representing common versions. Fixes aws#6532 BREAKING CHANGE: the property 'version' has been changed from string to an engine-specific version class; use VersionClass.of() if you need to create a specific version of an engine from a string * **rds**: the property ParameterGroupProps.family has been renamed to engine, and its type changed from string to IEngine * **rds**: the property engineVersion in IClusterEngine changed from a string to EngineVersion * **rds**: the property engineVersion in IInstanceEngine changed from a string to EngineVersion * **rds**: the property parameterGroupFamily in IClusterEngine changed from required to optional * **rds**: the property parameterGroupFamily in IInstanceEngine changed from required to optional
Change engine versions, for boh cluster and instance engines,
from strings to strongly-typed classes with static constants representing common versions.
Fixes #6532
BREAKING CHANGE: the property 'version' has been changed from string to an engine-specific
version class; use VersionClass.of() if you need to create a specific version of an engine from a string