我正在使用AWS CDK部署Aurora RDS集群。
const cluster = new rds.DatabaseCluster(this, 'id', {
...
parameterGroup: new rds.ClusterParameterGroup(this,'id', {
family: 'aurora-postgresql11'
}})
从ClusterParameterGroup构造中抛出Property Parameters cannot be empty
。知道为什么吗?
[当我尝试使用ClusterParameterGroup.fromParameterGroupName(this, "id", [a group that I manually created in the account]
时有效。
这里的问题是,我不想使用RDS创建的默认ParameterGroup,因为它们是不可修改的。
您可以自己创建ClusterParameterGroup
,然后将其传递给DatabaseCluster
。
代码段:
const rdsClusterPrameterGroup = new rds.ClusterParameterGroup(this, 'rdsClusterPrameterGroup', {
parameters: {
max_connections: props.AURORA_MAX_CONNECTIONS
},
family: props.AURRORA_DATABASE_FAMILY
});
const cluster = new rds.DatabaseCluster(this, 'id', {
...
parameterGroup: rdsClusterPrameterGroup
}})
有关ClusterParameterGroup的更多信息。