Skip to content

feat(rds): simpler way to configure parameters for instance and cluster#18126

Merged
mergify[bot] merged 26 commits intoaws:masterfrom
hoegertn:hoegertn-18124
Feb 15, 2022
Merged

feat(rds): simpler way to configure parameters for instance and cluster#18126
mergify[bot] merged 26 commits intoaws:masterfrom
hoegertn:hoegertn-18124

Conversation

@hoegertn
Copy link
Copy Markdown
Contributor

Fixes #18124


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
Copy Markdown

gitpod-io bot commented Dec 21, 2021

@hoegertn hoegertn marked this pull request as draft December 21, 2021 23:07
@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Dec 21, 2021
Copy link
Copy Markdown
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

Looks good @hoegertn! A few questions.

import * as cdk from '@aws-cdk/core';
import * as cxapi from '@aws-cdk/cx-api';
import * as rds from '../lib';
import { SqlServerEngineVersion } from '../lib';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nope! Use the qualified import (rds) from above please 🙂.

@hoegertn
Copy link
Copy Markdown
Contributor Author

I also added the cluster now. Currently, there are no README changes as the parameter group is also not documented. How should I proceed here?

@hoegertn hoegertn marked this pull request as ready for review December 22, 2021 08:46
@skinny85
Copy link
Copy Markdown
Contributor

skinny85 commented Dec 22, 2021

I also added the cluster now. Currently, there are no README changes as the parameter group is also not documented. How should I proceed here?

Let's add a section in the ReadMe, showing off the two ways of setting a ParameterGroup for an Instance/Cluster, and explaining under which circumstances would you use each of them.

@hoegertn
Copy link
Copy Markdown
Contributor Author

hoegertn commented Jan 5, 2022

@skinny85 Is there anything missing from my side?

@skinny85
Copy link
Copy Markdown
Contributor

skinny85 commented Jan 5, 2022

@skinny85 Is there anything missing from my side?

Probably nothing beyond the fact that you didn't re-request my approval, so I missed this 😃.

Copy link
Copy Markdown
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

Looks good @hoegertn! A few minor comments, mainly around docs.


new rds.DatabaseInstance(this, 'Database', {
engine: rds.DatabaseInstanceEngine.SQL_SERVER_EE,
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is optional, right? I think there's no need to include it in the example.


new rds.DatabaseInstance(this, 'Database', {
engine: rds.DatabaseInstanceEngine.sqlServerEe({ version: rds.SqlServerEngineVersion.VER_12_00_5000_0_V1 }),
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL),

key: 'value',
},
instanceProps: {
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL),
Copy link
Copy Markdown
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 get rid of this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Still not needed.

hoegertn and others added 2 commits January 6, 2022 12:03
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
@mergify mergify bot dismissed skinny85’s stale review January 6, 2022 11:04

Pull request has been modified.

hoegertn and others added 8 commits January 6, 2022 12:04
Co-authored-by: Jonathan Goldwasser <jogold@users.noreply.github.com>
Co-authored-by: Jonathan Goldwasser <jogold@users.noreply.github.com>
Co-authored-by: Jonathan Goldwasser <jogold@users.noreply.github.com>
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
@skinny85
Copy link
Copy Markdown
Contributor

skinny85 commented Feb 1, 2022

@hoegertn what's the status of this?

@hoegertn
Copy link
Copy Markdown
Contributor Author

hoegertn commented Feb 1, 2022

Sorry, had some busy weeks. I need to write the missing tests and then this is ready. I plan to finish this within the next days.

@skinny85
Copy link
Copy Markdown
Contributor

skinny85 commented Feb 1, 2022

Sounds great! No rush, I just wanted to make sure you weren't waiting on my review 🙂.

Re-request my review (there's a button in the top-right of the PR window, next to my avatar) once you're ready for another round of reviews!

@hoegertn hoegertn requested a review from skinny85 February 14, 2022 15:28
@skinny85 skinny85 changed the title feat(rds): simpler way to configure parameters for instance or cluster feat(rds): simpler way to configure parameters for instance and cluster Feb 14, 2022
Copy link
Copy Markdown
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

Looks great @hoegertn! Minor stylistic comments before we merge this in.

declare const vpc: ec2.Vpc;

new rds.DatabaseInstance(this, 'Database', {
engine: rds.DatabaseInstanceEngine.sqlServerEe({ version: rds.SqlServerEngineVersion.VER_12_00_5000_0_V1 }),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok. Can we make the above example use a versioned engine too then?

declare const vpc: ec2.Vpc;

new rds.DatabaseInstance(this, 'Database', {
engine: rds.DatabaseInstanceEngine.sqlServerEe({ version: rds.SqlServerEngineVersion.VER_12_00_5000_0_V1 }),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we use rds.SqlServerEngineVersion.VER_11 here too, like we do above?

Comment on lines +905 to +910
...props.parameters && {
dbParameterGroupName: new ParameterGroup(this, 'ParameterGroup', {
engine: props.engine,
parameters: props.parameters,
}).bindToInstance({}).parameterGroupName,
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we extract this all of this to a parameterGroupName: string | undefined local variable? This code is way, way too clever for my liking.

Comment on lines +393 to +395
credentials: {
username: 'admin',
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is optional, I would remove it from this test.

// WHEN
new rds.DatabaseInstance(stack, 'Database', {
engine: rds.DatabaseInstanceEngine.sqlServerEe({ version: rds.SqlServerEngineVersion.VER_12_00_5000_0_V1 }),
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is optional, I would remove it from this test.

engine: rds.DatabaseInstanceEngine.sqlServerEe({
version: rds.SqlServerEngineVersion.VER_11,
}),
description: 'desc',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is optional, I would remove it from this test.

expect(() => {
new rds.DatabaseInstance(stack, 'Database', {
engine: rds.DatabaseInstanceEngine.sqlServerEe({ version: rds.SqlServerEngineVersion.VER_12_00_5000_0_V1 }),
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is optional, I would remove it from this test.

Co-authored-by: Adam Ruka <adamruka85@gmail.com>
@mergify mergify bot dismissed skinny85’s stale review February 14, 2022 21:18

Pull request has been modified.

hoegertn and others added 6 commits February 14, 2022 22:19
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
@hoegertn hoegertn requested a review from skinny85 February 14, 2022 21:51
Copy link
Copy Markdown
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

👍

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Feb 14, 2022

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).

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 20c8925
  • 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 3ba9088 into aws:master Feb 15, 2022
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Feb 15, 2022

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).

akash1810 added a commit to guardian/cdk that referenced this pull request Feb 21, 2022
Since aws/aws-cdk#18126, this exact logic is handled by aws-cdk.
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
…er (aws#18126)

Fixes aws#18124


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
akash1810 added a commit to guardian/cdk that referenced this pull request Feb 22, 2022
Since aws/aws-cdk#18126, this exact logic is handled by aws-cdk.
@hoegertn hoegertn deleted the hoegertn-18124 branch April 10, 2022 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@aws-cdk/aws-rds Related to Amazon Relational Database

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(rds): simpler way to configure parameters for instance or cluster

4 participants