@@ -3,6 +3,7 @@ import * as rds from '@aws-cdk/aws-rds';
33import * as cdk from '@aws-cdk/core' ;
44import { SecretValue } from '@aws-cdk/core' ;
55import * as ssm from '@aws-cdk/aws-ssm' ;
6+ import { ParameterGroup } from '@aws-cdk/aws-rds' ;
67
78export interface DatabaseProps extends cdk . StackProps {
89 readonly clusterName : string ;
@@ -25,6 +26,15 @@ export class Database extends cdk.Stack {
2526 constructor ( scope : cdk . Construct , id : string , props : DatabaseProps ) {
2627 super ( scope , id , props ) ;
2728
29+ const parameterGroup = new rds . ParameterGroup ( this , "DBParameterGroup" , {
30+ engine : props . instanceEngine ?? rds . DatabaseInstanceEngine . mysql ( {
31+ version : rds . MysqlEngineVersion . VER_5_7 ,
32+ } ) ,
33+ parameters : {
34+ explicit_defaults_for_timestamp : "OFF"
35+ }
36+ } ) ;
37+
2838 // TODO: remove when the gitpod helm chart supports using secrets from ssm
2939 this . credentials = ssm . StringParameter . valueForStringParameter (
3040 this , `/gitpod/cluster/${ props . clusterName } /region/${ props . vpc . stack . region } ` , 1 ) ;
@@ -49,6 +59,7 @@ export class Database extends cdk.Stack {
4959 databaseName : 'gitpod' ,
5060 autoMinorVersionUpgrade : false ,
5161 deletionProtection : false ,
62+ parameterGroup
5263 } ) ;
5364
5465 // allow internally from the same security group
0 commit comments