Skip to content

Enable Advanced Database Insights using CloudFormation

0

Hi, We have a bunch of PostgreSQL RDS instances deployed using CloudFormation. We also have the standard database insights enabled, but I was wondering how to enable the advanced database insights using CloudFormation. The AWS:RDS:DBInstance guide has no reference to the advanced database insights

2 Answers
0

Hello.

Included in "AWS::RDS::DBCluster".
This can be set using the parameter "DatabaseInsightsMode".
Enabling Performance Insights as per the answer in AWS re:Post Agent does not enable Advanced Database Insights.
As of March 2025, it may not be possible to set it up using just "AWS::RDS::DBInstance". (I'll try doing some testing.)
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html

EXPERT
answered 9 months ago
  • I tried using the following CloudFormation template according to the answer from AWS re:Post Agent, but it was not activated. Therefore, as of March 2025, I don't think it can be enabled with just "AWS::RDS::DBInstance".

    AWSTemplateFormatVersion: "2010-09-09"
    Resources:
    
      RDSInstance:
        Type: "AWS::RDS::DBInstance"
        Properties:
          DBInstanceIdentifier: "test-rds"
          DBInstanceClass: "db.m5.large"
          Engine: "postgres"
          EngineVersion: "17.4"
          Ma sterUsername: "root"
          Ma sterUserPassword: "testriku"
          DBName: "test"
          BackupRetentionPeriod: 0
          MultiAZ: true
          PubliclyAccessible: false
          StorageType: "gp3"
          AllocatedStorage: 32
          StorageEncrypted: true
          CopyTagsToSnapshot: false
          DeletionProtection: false
          DeleteAutomatedBackups: true
          DBSubnetGroupName: test
          VPCSecurityGroups:
          - sg-abcdef
          EnablePerformanceInsights: true
          PerformanceInsightsRetentionPeriod: 465
    
-1

While CloudFormation doesn't have a direct property for enabling Advanced Database Insights, you can achieve this by configuring Performance Insights with specific settings in your CloudFormation template for your RDS instances.

To enable Advanced Database Insights using CloudFormation, you need to set the following properties for your AWS::RDS::DBInstance resource:

  1. Enable Performance Insights by setting 'EnablePerformanceInsights' to true.
  2. Set the 'PerformanceInsightsRetentionPeriod' to at least 465 days (which is approximately 15 months, the minimum for Advanced mode).

Here's an example of how you might configure this in your CloudFormation template:

MyDBInstance:
  Type: AWS::RDS::DBInstance
  Properties:
    Engine: postgres
    # ... other properties ...
    EnablePerformanceInsights: true
    PerformanceInsightsRetentionPeriod: 465

By setting these properties, you're effectively enabling the Advanced mode of Database Insights. The key is the retention period of at least 465 days, which is a characteristic of the Advanced mode.

Remember that enabling Advanced Database Insights will incur additional costs, as it provides extended data retention and advanced features compared to the Standard mode.

If you're updating existing instances, you may need to modify your CloudFormation template and update your stack. Be aware that changing these settings might require some downtime for your RDS instances.

Also, ensure that your IAM roles have the necessary permissions to enable and use Performance Insights and Database Insights features.
Sources
Turning on the Advanced mode of Database Insights for Amazon RDS - Amazon Relational Database Service
Turning on the Advanced mode of Database Insights for Amazon Aurora - Amazon Aurora
Get started with CloudWatch Database Insights - Amazon CloudWatch

answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.