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

fix(neptune-alpha): multiple cloudwatchLogsExports cannot be set when configuring log retention #28643

Merged
merged 27 commits into from
Jan 30, 2024

Conversation

badmintoncryer
Copy link
Contributor

@badmintoncryer badmintoncryer commented Jan 10, 2024

This PR includes a breaking change to the aws-neptune-alpha module.

I have resolved an issue where it was not possible to set multiple cloudwatchLogsExports when configuring log retention for a DatabaseCluster.

The root cause of the problem was that the LogRetention creation included [object object] in the construct's ID. With the current fix, the given logType can now be correctly included in the LogRetention.

- new logs.LogRetention(this, `${logType}LogRetention`, {..} // "DatabaseobjectObjectLogRetentionA247AF0C"
+ new logs.LogRetention(this, `${logType.value}LogRetention`, {..} // "DatabaseauditLogRetention8A29F5CC"

BREAKING CHANGE: Corrected LogRetention IDs for DatabaseCluster. Previously, regardless of the log type, the string ‘objectObject’ was always included, but after the correction, the log type is now included.

Closes #26295.


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

@github-actions github-actions bot added the p2 label Jan 10, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team January 10, 2024 06:11
@github-actions github-actions bot added the valued-contributor [Pilot] contributed between 6-12 PRs to the CDK label Jan 10, 2024
@badmintoncryer badmintoncryer changed the title fix(neptune-alpha): Multiple cloudwatchLogsExports cannot be set fix(neptune-alpha): Multiple cloudwatchLogsExports cannot be set when configuring log retention. Jan 10, 2024
@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p1 and removed p2 labels Jan 10, 2024
@@ -37,6 +38,7 @@ const cluster = new DatabaseCluster(stack, 'Database', {
vpc,
vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },
instanceType: InstanceType.R5_LARGE,
engineVersion: EngineVersion.V1_2_1_0,
Copy link
Contributor Author

@badmintoncryer badmintoncryer Jan 10, 2024

Choose a reason for hiding this comment

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

If engineVersion is not specified, CFN will create the cluster using the latest engine version. Currently, the latest engine is the v1.3 series, which the existing CDK code does not support.
(If the parameter group is also not set to v1.3, the deployment will fail.)

Therefore, in this integration test, the engineVersion and parameter group family have been explicitly set to v1.2.

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 plan to address the support for the v1.3 in a separate issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good, feel free to ping me for a review when you get around to that.

Copy link
Contributor Author

@badmintoncryer badmintoncryer Jan 27, 2024

Choose a reason for hiding this comment

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

@paulhcsun
This problem is resolved by #28647.
Do I need to conduct this integration test with version 1.3, or is it okay to proceed as it is?

@badmintoncryer badmintoncryer marked this pull request as ready for review January 10, 2024 06:33
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 10, 2024
@badmintoncryer badmintoncryer changed the title fix(neptune-alpha): Multiple cloudwatchLogsExports cannot be set when configuring log retention. fix(neptune-alpha): Multiple cloudwatchLogsExports cannot be set when configuring log retention Jan 10, 2024
@paulhcsun paulhcsun changed the title fix(neptune-alpha): Multiple cloudwatchLogsExports cannot be set when configuring log retention fix(neptune-alpha): multiple cloudwatchLogsExports cannot be set when configuring log retention Jan 11, 2024
@badmintoncryer badmintoncryer marked this pull request as draft January 18, 2024 17:06
@badmintoncryer badmintoncryer changed the title fix(neptune-alpha): multiple cloudwatchLogsExports cannot be set when configuring log retention fix(neptune-alpha): multiple cloudwatchLogsExports cannot be set when configuring log retention (under feature flag) Jan 18, 2024
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 18, 2024
@badmintoncryer badmintoncryer marked this pull request as ready for review January 18, 2024 21:30
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 19, 2024
@mergify mergify bot dismissed paulhcsun’s stale review January 25, 2024 22:17

Pull request has been modified.

Copy link
Contributor

@paulhcsun paulhcsun left a comment

Choose a reason for hiding this comment

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

@badmintoncryer You're right, sorry I misread the section in the Contributing guide on allowing breaking changes. Codewise this looks good to me, could you just update your PR description so that the BREAKING CHANGE: callout includes an explanation of the behaviour before and the behaviour now? I'm good to approve after that's been updated.

@badmintoncryer
Copy link
Contributor Author

@paulhcsun Thank you for confirming. I have updated the description. Could you please check it again?

@mergify mergify bot dismissed paulhcsun’s stale review January 26, 2024 17:24

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 26, 2024
paulhcsun
paulhcsun previously approved these changes Jan 26, 2024
Copy link
Contributor

@paulhcsun paulhcsun left a comment

Choose a reason for hiding this comment

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

The breaking change callout looks good to me. Nice work @badmintoncryer!

@@ -37,6 +38,7 @@ const cluster = new DatabaseCluster(stack, 'Database', {
vpc,
vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },
instanceType: InstanceType.R5_LARGE,
engineVersion: EngineVersion.V1_2_1_0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good, feel free to ping me for a review when you get around to that.

@badmintoncryer
Copy link
Contributor Author

Why is the CodeBuild job in a pending state..??

@badmintoncryer
Copy link
Contributor Author

@paulhcsun Could you please re-run the CodeBuild job?

@mergify mergify bot dismissed paulhcsun’s stale review January 29, 2024 21:49

Pull request has been modified.

paulhcsun
paulhcsun previously approved these changes Jan 29, 2024
Copy link
Contributor

mergify bot commented Jan 29, 2024

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-maintainer-review This PR needs a review from a Core Team Member label Jan 29, 2024
Copy link
Contributor

mergify bot commented Jan 29, 2024

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

@mergify mergify bot dismissed paulhcsun’s stale review January 29, 2024 23:56

Pull request has been modified.

paulhcsun
paulhcsun previously approved these changes Jan 30, 2024
@mergify mergify bot dismissed paulhcsun’s stale review January 30, 2024 00:11

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Copy link
Contributor

mergify bot commented Jan 30, 2024

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

@mergify mergify bot merged commit 56794fc into aws:main Jan 30, 2024
11 checks passed
@badmintoncryer badmintoncryer deleted the 26295-logExport branch January 30, 2024 03:36
SankyRed pushed a commit that referenced this pull request Feb 8, 2024
…en configuring log retention (#28643)

This PR includes a breaking change to the aws-neptune-alpha module.

I have resolved an issue where it was not possible to set multiple `cloudwatchLogsExports` when configuring log retention for a `DatabaseCluster`.

The root cause of the problem was that the LogRetention creation included `[object object]` in the construct's ID. With the current fix, the given `logType` can now be correctly included in the `LogRetention`.
```diff
- new logs.LogRetention(this, `${logType}LogRetention`, {..} // "DatabaseobjectObjectLogRetentionA247AF0C"
+ new logs.LogRetention(this, `${logType.value}LogRetention`, {..} // "DatabaseauditLogRetention8A29F5CC"
```

BREAKING CHANGE: Corrected LogRetention IDs for DatabaseCluster. Previously, regardless of the log type, the string ‘objectObject’ was always included, but after the correction, the log type is now included.


Closes #26295.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort p1 valued-contributor [Pilot] contributed between 6-12 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(neptune-alpha): Unable to set custom retention period for multiple CloudWatch log exports
3 participants