Describe the bug
Issues with @aws-cdk/aws-rds
DatabaseInstanceFromSnapshot ignores the enablePerformanceInsights parameter
and always generates EnablePerformanceInsights: true in the CloudFormation
template, regardless of the value passed to the construct.
Regression Issue
Last Known Working CDK Library Version
2.1101.0
Expected Behavior
When enablePerformanceInsights=False is passed to DatabaseInstanceFromSnapshot, the generated CloudFormation template should contain EnablePerformanceInsights: false.
Current Behavior
The generated CloudFormation template always shows EnablePerformanceInsights: true regardless of the parameter value. Running cdk synth confirms the property is hardcoded to true.
Reproduction Steps
from aws_cdk import Stack, aws_rds as rds, aws_ec2 as ec2
from constructs import Construct
class TestStack(Stack):
def init(self, scope: Construct, id: str, **kwargs):
super().init(scope, id, **kwargs)
vpc = ec2.Vpc.from_lookup(self, "VPC", vpc_id="vpc-xxxxx")
# Create instance from snapshot with Performance Insights disabled
instance = rds.DatabaseInstanceFromSnapshot(
self, "TestInstance",
snapshot_identifier="my-snapshot-arn",
engine=rds.DatabaseInstanceEngine.oracle_ee(
version=rds.OracleEngineVersion.VER_19
),
instance_type=ec2.InstanceType.of(
ec2.InstanceClass.R5,
ec2.InstanceSize.LARGE
),
vpc=vpc,
enable_performance_insights=False, # This is ignored
)
Possible Solution
instance = rds.DatabaseInstanceFromSnapshot(self, "TestInstance", ...)
if not enable_performance_insights:
cfn_instance = instance.node.default_child
cfn_instance.add_property_override("EnablePerformanceInsights", False)
Additional Information/Context
No response
AWS CDK Library version (aws-cdk-lib)
2.234.1
AWS CDK CLI version
2.1101.0
Node.js Version
v22.21.0
OS
Linux
Language
Python
Language Version
Python 3.12
Other information
No response
Describe the bug
Issues with @aws-cdk/aws-rds
DatabaseInstanceFromSnapshot ignores the enablePerformanceInsights parameter
and always generates EnablePerformanceInsights: true in the CloudFormation
template, regardless of the value passed to the construct.
Regression Issue
Last Known Working CDK Library Version
2.1101.0
Expected Behavior
When enablePerformanceInsights=False is passed to DatabaseInstanceFromSnapshot, the generated CloudFormation template should contain EnablePerformanceInsights: false.
Current Behavior
The generated CloudFormation template always shows EnablePerformanceInsights: true regardless of the parameter value. Running cdk synth confirms the property is hardcoded to true.
Reproduction Steps
from aws_cdk import Stack, aws_rds as rds, aws_ec2 as ec2
from constructs import Construct
class TestStack(Stack):
def init(self, scope: Construct, id: str, **kwargs):
super().init(scope, id, **kwargs)
Possible Solution
instance = rds.DatabaseInstanceFromSnapshot(self, "TestInstance", ...)
if not enable_performance_insights:
cfn_instance = instance.node.default_child
cfn_instance.add_property_override("EnablePerformanceInsights", False)
Additional Information/Context
No response
AWS CDK Library version (aws-cdk-lib)
2.234.1
AWS CDK CLI version
2.1101.0
Node.js Version
v22.21.0
OS
Linux
Language
Python
Language Version
Python 3.12
Other information
No response