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): add support for monitoring to DatabaseCluster #2828

Merged
merged 2 commits into from
Oct 3, 2019

Conversation

rpanfili
Copy link
Contributor

@rpanfili rpanfili commented Jun 11, 2019

Lets a user specify a monitoring interval period. This change will also auto-generate a valid Role to manage DB instances monitoring.

This change adds an optional prop monitoringInterval

closes #2826

BREAKING CHANGE:
* rds: monitoringInterval in DatabaseInstanceNewProps has been renamed to monitoringIntervalSec


Pull Request Checklist

  • Testing
    • Unit test added (prefer not to modify an existing test, otherwise, it's probably a breaking change)
    • CLI change?: coordinate update of integration tests with team
    • cdk-init template change?: coordinated update of integration tests with team
  • Docs
    • jsdocs: All public APIs documented
    • README: README and/or documentation topic updated
    • Design: For significant features, design document added to design folder
  • Title and Description
    • Change type: title prefixed with fix, feat and module name in parens, which will appear in changelog
    • Title: use lower-case and doesn't end with a period
    • Breaking?: last paragraph: "BREAKING CHANGE: <describe what changed + link for details>"
    • Issues: Indicate issues fixed via: "Fixes #xxx" or "Closes #xxx"
  • Sensitive Modules (requires 2 PR approvers)
    • IAM Policy Document (in @aws-cdk/aws-iam)
    • EC2 Security Groups and ACLs (in @aws-cdk/aws-ec2)
    • Grant APIs (only if not based on official documentation with a reference)

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

@rpanfili rpanfili requested a review from a team as a code owner June 11, 2019 20:39
@rpanfili rpanfili changed the title feat(rds): add support for monitoring to database cluster feat(rds): add support for monitoring to DatabaseCluster Jun 11, 2019
*
* @default no enhanced monitoring
*/
readonly monitoringInterval?: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please annotate this property with a unit. Recommended: monitoringIntervalSec.

Although @RomainMuller is currently working on a Duration class which will be the recommended practice going forward.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed that property in DatabaseClusterProps and in DatabaseInstanceNewProps as suggested.
I also added the Breaking advise and rebased to master!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rix0rrr I've seen that the Duration class has landed on master branch so I updated this PR with those required changes. Let me know if you need anything else!

@rix0rrr
Copy link
Contributor

rix0rrr commented Jun 12, 2019

Other than that, looks good!

@rpanfili rpanfili force-pushed the master branch 8 times, most recently from b5e78f4 to 6e626c5 Compare June 20, 2019 16:25
@rix0rrr
Copy link
Contributor

rix0rrr commented Jun 21, 2019

Needs a merge from master, unfortunately :(

@rpanfili
Copy link
Contributor Author

@rix0rrr rebased!

@rpanfili
Copy link
Contributor Author

@rix0rrr rebased!

and rebased again :)

Copy link
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! Just one tiny addition :)


let monitoringRole;
if (props.monitoringInterval && props.monitoringInterval.toSeconds()) {
monitoringRole = new Role(this, "MonitoringRole", {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's nice that we default this, but can we also allow specifying this in props? monitoringRole is probably a good name for that 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.

ok, great!

@mergify
Copy link
Contributor

mergify bot commented Sep 11, 2019

Thanks so much for taking the time to contribute to the AWS CDK ❤️

We will shortly assign someone to review this pull request and help get it
merged. In the meantime, please take a minute to make sure you follow this
checklist
:

  • PR title type(scope): text
    • type: fix, feat, refactor go into CHANGELOG, chore is hidden
    • scope: name of module without aws- or cdk- prefix or postfix (e.g. s3 instead of aws-s3-deployment)
    • text: use all lower-case, do not end with a period, do not include issue refs
  • PR Description
    • Rationale: describe rationale of change and approach taken
    • Issues: indicate issues fixed via: fixes #xxx or closes #xxx
    • Breaking?: last paragraph: BREAKING CHANGE: <describe what changed + link for details>
  • Testing
    • Unit test added. Prefer to add a new test rather than modify existing tests
    • CLI or init templates change? Re-run/add CLI integration tests
  • Documentation
    • README: update module README to describe new features
    • API docs: public APIs must be documented. Copy from official AWS docs when possible
    • Design: for significant features, follow design process


let monitoringRole;
if (props.monitoringInterval && props.monitoringInterval.toSeconds()) {
monitoringRole = props.monitoringRole || new Role(this, "MonitoringRole", {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to have the same optional monitoringRole for an instance.

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! done

Let a user define a monitoring interval period. It will be
also possible to specify a monitoring IAM Role to manage instances
monitoring, otherwise a valid Role will be auto-generated.

This change adds optional props `monitoringInterval` and `monitoringRole`
to `DatabaseClusterProps` and optional `monitoringRole` to
`DatabaseInstanceProps`

closes aws#2826
Copy link
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.

Thanks for the contribution @rpanfili , and apologies for approving this so late!

@mergify
Copy link
Contributor

mergify bot commented Oct 3, 2019

Thank you for contributing! Your pull request is now being automatically merged.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • 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 910c8bf into aws:master Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for monitoring to RDS DatabaseCluster
6 participants