Skip to content

Commit e718303

Browse files
chore: adds back static tagging
1 parent 22dbcd3 commit e718303

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/cdk/resources/OpenSearchResources.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {Construct} from "constructs"
22
import {Role} from "aws-cdk-lib/aws-iam"
3+
import {Tags} from "aws-cdk-lib"
34
import {
45
VectorCollection,
56
VectorCollectionStandbyReplicas
@@ -9,6 +10,7 @@ export interface OpenSearchResourcesProps {
910
readonly stackName: string
1011
readonly bedrockExecutionRole: Role
1112
readonly region: string
13+
readonly collectionName?: string
1214
}
1315

1416
export class OpenSearchResources extends Construct {
@@ -19,11 +21,15 @@ export class OpenSearchResources extends Construct {
1921

2022
// Create the OpenSearch Serverless collection using L2 construct
2123
this.collection = new VectorCollection(this, "Collection", {
22-
collectionName: `${props.stackName}-vector-db`,
24+
collectionName: props.collectionName ?? `${props.stackName}-vector-db`,
2325
description: "EPS Assist Vector Store",
2426
standbyReplicas: VectorCollectionStandbyReplicas.DISABLED
2527
})
2628

29+
// set static values for commit and version tags to stop it being recreated
30+
Tags.of(this.collection).add("commit", "static_value")
31+
Tags.of(this.collection).add("version", "static_value")
32+
2733
// Grant access to the Bedrock execution role
2834
this.collection.grantDataAccess(props.bedrockExecutionRole)
2935

0 commit comments

Comments
 (0)