Skip to content

Commit e4dfa6b

Browse files
fix: dynamoic collection name
1 parent e096967 commit e4dfa6b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/cdk/resources/OpenSearchResources.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface OpenSearchResourcesProps {
99
readonly stackName: string
1010
readonly bedrockExecutionRole: Role
1111
readonly region: string
12+
readonly commitId: string
1213
}
1314

1415
export class OpenSearchResources extends Construct {
@@ -17,9 +18,11 @@ export class OpenSearchResources extends Construct {
1718
constructor(scope: Construct, id: string, props: OpenSearchResourcesProps) {
1819
super(scope, id)
1920

21+
const commitShort = props.commitId.substring(0, 4)
22+
2023
// Create the OpenSearch Serverless collection using L2 construct
2124
this.collection = new VectorCollection(this, "Collection", {
22-
collectionName: `${props.stackName}-vector-db`,
25+
collectionName: `${props.stackName}-${commitShort}-vector-db`,
2326
description: "EPS Assist Vector Store",
2427
standbyReplicas: VectorCollectionStandbyReplicas.DISABLED
2528
})

packages/cdk/stacks/EpsAssistMeStack.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export class EpsAssistMeStack extends Stack {
8080
const openSearchResources = new OpenSearchResources(this, "OpenSearchResources", {
8181
stackName: props.stackName,
8282
bedrockExecutionRole: bedrockExecutionRole.role,
83+
commitId: props.commitId,
8384
region
8485
})
8586

0 commit comments

Comments
 (0)