Skip to content

Commit e56fdb0

Browse files
committed
Change RDS Mysql settings (sync with upstream)
Signed-off-by: Manuel Alejandro de Brito Fontes <[email protected]>
1 parent fd57e0c commit e56fdb0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/database.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as rds from '@aws-cdk/aws-rds';
33
import * as cdk from '@aws-cdk/core';
44
import { SecretValue } from '@aws-cdk/core';
55
import * as ssm from '@aws-cdk/aws-ssm';
6+
import { ParameterGroup } from '@aws-cdk/aws-rds';
67

78
export 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

Comments
 (0)