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

Can not enable Performance Insights for DatabaseCluster #5195

Closed
vertti opened this issue Nov 26, 2019 · 9 comments
Closed

Can not enable Performance Insights for DatabaseCluster #5195

vertti opened this issue Nov 26, 2019 · 9 comments
Assignees
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database closing-soon This issue will automatically close in 4 days unless further comments are made. guidance Question that needs advice or information.

Comments

@vertti
Copy link

vertti commented Nov 26, 2019

I would like to enable Performance Insights for my RDS Postgresql cluster but it doesn't seem to be possible.

Reproduction Steps

DatabaseInstanceProps has a key enablePerformanceInsights but DatabaseClusterProps does not have that key. Also the instanceProps contained inside DatabaseClusterProps is InstanceProps type and does not have the enablePerformanceInsights key either.

Environment

  • CLI Version : 1.18.0
  • Framework Version: 1.18.0
  • OS : Ubuntu
  • Language : Typescript

This is 🐛 Bug Report

@vertti vertti added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 26, 2019
@SomayaB SomayaB added the @aws-cdk/aws-rds Related to Amazon Relational Database label Nov 26, 2019
@skinny85
Copy link
Contributor

Hey @vertti ,

unfortunately, the Cluster resource does not have an enablePerformanceInsights property, unlike the Instance resource, so I don't think this can actually be done.

Thanks,
Adam

@skinny85 skinny85 added guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 26, 2019
@skinny85 skinny85 added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Dec 8, 2019
@SomayaB
Copy link
Contributor

SomayaB commented Dec 16, 2019

Closing this issue. Feel free to reopen.

@SomayaB SomayaB closed this as completed Dec 16, 2019
@vincent-dm
Copy link

We are also facing this issue. Currently our workaround is to get the instance identifiers and then enable performance insights using the SDK, which feels like a hack. What is the recommended way to enable performance insights using CDK on instances created using DatabaseCluster?

@mikevoets
Copy link

You can now enable performance insights with CDK v2 by setting enablePerformanceInsights in the instanceProps object:

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.InstanceProps.html
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.InstanceProps.html#enableperformanceinsights

@Aarbel
Copy link

Aarbel commented Apr 3, 2023

You can now enable performance insights with CDK v2 by setting enablePerformanceInsights in the instanceProps object:

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.InstanceProps.html https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.InstanceProps.html#enableperformanceinsights

@mikevoets no way to do it with CDK v1 ?

@mikevoets
Copy link

You can now enable performance insights with CDK v2 by setting enablePerformanceInsights in the instanceProps object:
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.InstanceProps.html https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.InstanceProps.html#enableperformanceinsights

@mikevoets no way to do it with CDK v1 ?

There doesn't seem to be any official way to do it in CDK v1. I don't know v1 so I don't know if there's any workaround.

@Aarbel
Copy link

Aarbel commented Apr 4, 2023

@mikevoets

after a full day of diving, with 1.135.0 i did this:

const kmsKey = kms.Key.fromKeyArn(
  this,
  "rdsKmsKeyForPerformanceInsights",
  RDS_KMS_KEY_ARN
);

new rds.DatabaseCluster(this, "Database", {
  credentials,
  engine: rds.DatabaseClusterEngine.auroraPostgres({
    version: rds.AuroraPostgresEngineVersion.VER_13_4,
  }),
  instanceProps: {
    enablePerformanceInsights: true,
    parameters: {
      log_min_duration_statement: 500,
    },
    performanceInsightEncryptionKey: kmsKey,
    performanceInsightRetention: rds.PerformanceInsightRetention.LONG_TERM,
    instanceType: ec2.InstanceType.of(
      ec2.InstanceClass.BURSTABLE3,
      ec2.InstanceSize.XLARGE
    ),
    vpc,
  },
  removalPolicy: cdk.RemovalPolicy.RETAIN,
});

@MichaelWalker-git
Copy link

It's wild, that despite it being Q4 2024 and instanceProps being deprecated, there is no way to do this via the CDK still

@mikevoets
Copy link

mikevoets commented Dec 6, 2024

It's wild, that despite it being Q4 2024 and instanceProps being deprecated, there is no way to do this via the CDK still

@MichaelWalker-git This is how I solved it via CDK:

new rds.DatabaseCluster(this, "Database", {
  vpc,
  writer: rds.ClusterInstance.provisioned('WriterInstance', { 
    instanceType: new ec2.InstanceType('t3.medium'),
    enablePerformanceInsights: true,
    // other instance properties...
  }),
  // other cluster properties...
});

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 closing-soon This issue will automatically close in 4 days unless further comments are made. guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

7 participants