There's two simultaneous causes of this error:
Aurora versions are restricted based on the instance type
You need to specify the engineVersion
for each cluster instance (as well as the cluster itself).
Resulting code (I'm using Pulumi, but the same logic applies for Terraform, raw CloudFormation etc).
const rdsCluster = new aws.rds.Cluster("default", {
clusterIdentifier: config.database.clusterName,
engine: "aurora-postgresql",
// Restricted based on https://docs.amazonaws.cn/en_us/AmazonRDS/latest/AuroraUserGuide/Concepts.DBInstanceClass.html#Concepts.DBInstanceClass.SupportAurora
engineVersion: "12.7",
databaseName: config.database.name,
masterUsername: config.database.username,
masterPassword: config.database.password,
dbSubnetGroupName: rdsSubnetGroup.name,
storageEncrypted: true,
});
// https://www.pulumi.com/docs/reference/pkg/aws/rds/clusterinstance/#engineversion_nodejs
const clusterInstances: Array<aws.rds.ClusterInstance> = [];
for (let range = 0; range < config.database.instanceCount; range++) {
clusterInstances.push(
new aws.rds.ClusterInstance(`clusterInstances-${range}`, {
identifier: `aurora-cluster-demo-${range}`,
clusterIdentifier: rdsCluster.id,
instanceClass: config.database.instanceType,
// Engine must be specified otherwise AWS will give a misleading error about DB versions not being available.
// https://github.com/hashicorp/terraform-provider-aws/issues/2419#issuecomment-347060274
engine: "aurora-postgresql",
engineVersion: "12.7",
})
);
}