[英]Set parameter group for the default database of cdk generated
I am making RDS by cdk我正在通过 cdk 制作 RDS
with default database.使用默认数据库。
const dbCluster = new rds.DatabaseCluster(this, 'Database', {
engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_2_08_1 }),
credentials: rdsCredentials,
removalPolicy: cdk.RemovalPolicy.DESTROY,
clusterIdentifier: dbInfos['cluster'], //clusterIdentifier,
defaultDatabaseName :dbInfos['database'], //defaultDatabaseName,
instanceProps: {
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL),
vpcSubnets: {
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
},
vpc,
securityGroups:[mySecurityGroup],
},
});
I want to set the character code(utf8mb4) for this default database.我想为此默认数据库设置字符代码 (utf8mb4)。
I think I should use the parameter group for this though,,,我想我应该为此使用参数组,,,
where can I set the parameter group?我在哪里可以设置参数组?
I make the parameterGroup like this.我像这样制作参数组。
const parameterGroup = new rds.ParameterGroup(this, 'RdsParameterGroup', {
engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_2_08_1 }),
parameters: {
time_zone: 'Asia/Tokyo',
character_set_client: 'utf8mb4',
character_set_connection: 'utf8mb4',
character_set_database: 'utf8mb4',
character_set_results: 'utf8mb4',
character_set_server: 'utf8mb4',
collation_connection: 'utf8mb4_bin',
slow_query_log: '1',
long_query_time: '1',
log_output: 'FILE',
},
})
and adding并添加
const dbCluster = new rds.DatabaseCluster(this, 'Database', {
parameterGroup,
.
.
.
DatabaseCluster has a parameterGroup argument. DatabaseCluster 有一个 parameterGroup 参数。 Have you looked at it?
你看过了吗? The same can be updated using the ParameterGroup or the L1 version of it with "CfnDBParameterGroup"
同样可以使用 ParameterGroup 或它的 L1 版本与“CfnDBParameterGroup”进行更新
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.