Skip to content

Commit

Permalink
fix: parameter group (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
mazyu36 authored Feb 16, 2025
1 parent f882cba commit 396f3e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
16 changes: 9 additions & 7 deletions lib/constructs/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ export class Database extends Construct implements ec2.IConnectable {
enableDataApi: true,
storageEncrypted: true,
removalPolicy: RemovalPolicy.DESTROY,
parameterGroup: new rds.ParameterGroup(this, 'ParameterGroup', {
engine,
parameters: {
// Terminate idle session for Aurora Serverless V2 auto-pause
idle_session_timeout: '60000',
},
}),
parameterGroup: auroraScalesToZero
? // Terminate idle session for Aurora Serverless V2 auto-pause
new rds.ParameterGroup(this, 'ParameterGroup', {
engine,
parameters: {
idle_session_timeout: '60000',
},
})
: undefined,
});

this.connections = cluster.connections;
Expand Down
14 changes: 1 addition & 13 deletions test/__snapshots__/langfuse-with-aws-cdk-prod.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1574,9 +1574,7 @@ exports[`snapshot test for prod 1`] = `
"DeletionPolicy": "Delete",
"Properties": {
"CopyTagsToSnapshot": true,
"DBClusterParameterGroupName": {
"Ref": "DatabaseParameterGroup2A921026",
},
"DBClusterParameterGroupName": "default.aurora-postgresql16",
"DBSubnetGroupName": {
"Ref": "DatabaseClusterSubnets5540150D",
},
Expand Down Expand Up @@ -1775,16 +1773,6 @@ exports[`snapshot test for prod 1`] = `
"Type": "AWS::RDS::DBInstance",
"UpdateReplacePolicy": "Delete",
},
"DatabaseParameterGroup2A921026": {
"Properties": {
"Description": "Cluster parameter group for aurora-postgresql16",
"Family": "aurora-postgresql16",
"Parameters": {
"idle_session_timeout": "60000",
},
},
"Type": "AWS::RDS::DBClusterParameterGroup",
},
"LoadBalancerAlbAccessLogBucket57C7E043": {
"DeletionPolicy": "Delete",
"Properties": {
Expand Down

0 comments on commit 396f3e6

Please sign in to comment.