From 590f0c075c87555c3e0e4664fbcb8bb54e110dc6 Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Wed, 15 Jul 2026 15:54:14 -0400 Subject: [PATCH] fix(infra): grant KB role rds:DescribeDBClusters (prod deploy blocker) (#229) The seahaven-prod deploy failed at CreateKnowledgeBase: the Bedrock KB execution role (proposal-system-kb-role) was denied rds:DescribeDBClusters, which Bedrock calls to validate the Aurora pgvector store config. Add it. rds:DescribeDBClusters does NOT support resource-level scoping (account/region list action) so it must be Resource:*; the role's sensitive actions (rds-data:*, s3, InvokeModel, secret) stay tightly scoped. GPT-4.1 cross-review APPROVE (caught the Resource:* requirement). --- infra/lib/compute-stack.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/infra/lib/compute-stack.ts b/infra/lib/compute-stack.ts index 95b88b0..867d38c 100644 --- a/infra/lib/compute-stack.ts +++ b/infra/lib/compute-stack.ts @@ -86,6 +86,17 @@ export class ComputeStack extends cdk.Stack { resources: [`arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v2:0`], })); + // Bedrock validates the Aurora vector-store config at KB-create time by calling + // rds:DescribeDBClusters — required or CreateKnowledgeBase 400s with "storage + // configuration provided is invalid" / rds:DescribeDBClusters AccessDenied. + // NOTE: rds:DescribeDBClusters does NOT support resource-level permissions (it is an + // account/region list action), so it must be Resource:* — scoping to the cluster ARN + // grants nothing. Read-only metadata; the role's sensitive actions stay scoped. + kbRole.addToPolicy(new iam.PolicyStatement({ + actions: ['rds:DescribeDBClusters'], + resources: ['*'], + })); + // KB queries the pgvector table via the RDS Data API as bedrock_user. kbRole.addToPolicy(new iam.PolicyStatement({ actions: [