Skip to content
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): Support Aurora I/O Optimized for Aurora database. #25704

Merged
merged 2 commits into from
May 30, 2023

Conversation

Zishanwang1992
Copy link
Contributor

Closes #25629


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented May 23, 2023

@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels May 23, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team May 23, 2023 20:26
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label May 23, 2023
Copy link
Contributor

@corymhall corymhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Zishanwang1992 thanks for the PR! Just 1 minor comment.

*
* @default: `aurora` (Aurora DB clusters); `io1` (Multi-AZ DB clusters)
*/
readonly storageType?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this into an enum?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. I originally used enum, but run into issue because the CloudFormation defines it as string.

Now I have better understanding, I can define it as enum and convert it to string when used. Let me work on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@corymhall Could you help review the updated version? I have changed this to enum.

@mergify mergify bot dismissed corymhall’s stale review May 24, 2023 18:03

Pull request has been modified.

vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC },
vpc,
},
storageType: 'aurora-iopt1',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this to use the enum.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will address this.

/**
* Storage type for Multi-AZ DB clusters.
*/
IO1 = 'io1',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove io1 since the DatebaseCluster only supports aurora.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will remove this.

@@ -498,6 +527,7 @@ abstract class DatabaseClusterNew extends DatabaseClusterBase {
deletionProtection: defaultDeletionProtection(props.deletionProtection, props.removalPolicy),
enableIamDatabaseAuthentication: props.iamAuthentication,
networkType: props.networkType,
storageType: props.storageType?.toString(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when you just leave this as storageType: props.storageType? You shouldn't need to do toString().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will have a warning for "identifier expected". Here is another code with similar implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@corymhall I have updated the code. Please help review.

@mergify mergify bot dismissed corymhall’s stale review May 25, 2023 15:44

Pull request has been modified.

* The storage type to be associated with the DB cluster.
* Valid values: `aurora` , `aurora-iopt1` (Aurora DB clusters); `io1` (Multi-AZ DB clusters)
*
* @default: `aurora` (Aurora DB clusters); `io1` (Multi-AZ DB clusters)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @default: `aurora` (Aurora DB clusters); `io1` (Multi-AZ DB clusters)
* @default: DBClusterStorageType.AURORA

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@@ -276,6 +276,14 @@ interface DatabaseClusterBaseProps {
*/
readonly storageEncryptionKey?: kms.IKey;

/**
* The storage type to be associated with the DB cluster.
* Valid values: `aurora` , `aurora-iopt1` (Aurora DB clusters); `io1` (Multi-AZ DB clusters)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Valid values: `aurora` , `aurora-iopt1` (Aurora DB clusters); `io1` (Multi-AZ DB clusters)

The valid values will come from the enum.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@@ -28,6 +28,22 @@ const cluster = new rds.DatabaseCluster(this, 'Database', {
});
```

To adopt Aurora I/O-Optimized. Speicify `aurora-iopt1` on the `storageType` property.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To adopt Aurora I/O-Optimized. Speicify `aurora-iopt1` on the `storageType` property.
To adopt Aurora I/O-Optimized. Speicify `DBClusterStorageType.AURORA_IOPT1` on the `storageType` property.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@corymhall Updated. Please help review.

@mergify mergify bot dismissed corymhall’s stale review May 26, 2023 22:16

Pull request has been modified.

@mergify
Copy link
Contributor

mergify bot commented May 30, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label May 30, 2023
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 68cab76
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit f5797b2 into aws:main May 30, 2023
@mergify
Copy link
Contributor

mergify bot commented May 30, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-cdk-lib.aws_rds: Cluster storage configuration
3 participants