diff --git a/infra/lib/foundation-stack.ts b/infra/lib/foundation-stack.ts index b2fa4ab..c5bb5ef 100644 --- a/infra/lib/foundation-stack.ts +++ b/infra/lib/foundation-stack.ts @@ -88,7 +88,11 @@ export class FoundationStack extends cdk.Stack { // PR3: replaced the RDS instance + OpenSearch Serverless with Aurora + pgvector // (kills the AOSS OCU floor; scales toward 0 ACU when idle). Data API is required // by Bedrock Knowledge Bases to query the vector table. - const dbCluster = new rds.DatabaseCluster(this, 'Database', { + // Construct ID is 'AuroraCluster' (not 'Database') so CloudFormation gets a NEW + // logical ID for the cluster — the old RDS DBInstance shared logical ID 'Database*' + // and CFN forbids changing a resource's type in place ("Update of resource type is + // not permitted"). A distinct ID makes it a clean replace instead. + const dbCluster = new rds.DatabaseCluster(this, 'AuroraCluster', { clusterIdentifier: `proposal-system-db${config.stackSuffix}`, engine: rds.DatabaseClusterEngine.auroraPostgres({ version: rds.AuroraPostgresEngineVersion.VER_15_4,