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 logRetentions property to clusters and instances #28218

Closed
wants to merge 8 commits into from
Closed

feat(rds): Add logRetentions property to clusters and instances #28218

wants to merge 8 commits into from

Conversation

snaksa
Copy link
Contributor

@snaksa snaksa commented Dec 1, 2023

Add a logRetentions property to the Cluster and Instance objects to be able to get the generated CloudWatch LogGroup ARN. The type of the field is {[key:string]: logs.LogRetention} and allows accessing the LogGroup for a certain log type provided through the cloudwatchLogsExports property.

// Exporting logs from an instance
const instance = new rds.DatabaseInstance(this, 'Instance', {
  engine: rds.DatabaseInstanceEngine.postgres({
    version: rds.PostgresEngineVersion.VER_15_2,
  }),
  vpc,
  cloudwatchLogsExports: ['postgresql'], // Export the PostgreSQL logs
  // ...
});

// Access the generated LogGroup ARN for the "postgresql" log type
const postgresqlLogGroupArn = instance.logRetentions.postgresql.logGroupArn;

Closes #20358.


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

@aws-cdk-automation aws-cdk-automation requested a review from a team December 1, 2023 11:25
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1 labels Dec 1, 2023
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@snaksa snaksa changed the title feat(aws-rds): Add logRetentions property to clusters and instances feat(rds): Add logRetentions property to clusters and instances Dec 1, 2023
@snaksa
Copy link
Contributor Author

snaksa commented Dec 1, 2023

Exemption Request: I could not find any existing integration tests. Please let me know in case I missed something.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Dec 1, 2023
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Dec 1, 2023
@scanlonp
Copy link
Contributor

scanlonp commented Dec 4, 2023

@snaksa The RDS integ tests live here https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk-testing/framework-integ/test/aws-rds/test ! This looks good, a couple integ tests and we should be good to go.

@scanlonp scanlonp self-assigned this Dec 4, 2023
@scanlonp scanlonp removed the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Dec 4, 2023
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Dec 4, 2023
@snaksa
Copy link
Contributor Author

snaksa commented Dec 11, 2023

@scanlonp Does this change need an integration test? It just exposes the generated LogRetention records and is not making any changes to the final synthesized result.

@aws-cdk-automation
Copy link
Collaborator

The pull request linter fails with the following errors:

❌ Features must contain a change to an integration test file and the resulting snapshot.

PRs must pass status checks before we can provide a meaningful review.

If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing Exemption Request and/or Clarification Request.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@snaksa snaksa closed this Dec 22, 2023
@snaksa snaksa deleted the feat/rds-log-retentions-property branch December 27, 2023 18:01
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/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-cdk-lib/aws-rds/DatabaseInstance: Get log group of cloudwatchLogsExports
3 participants