File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import {VectorCollection} from "@cdklabs/generative-ai-cdk-constructs/lib/cdk-li
44import { RemovalPolicy } from "aws-cdk-lib"
55
66export interface VectorIndexProps {
7- readonly indexName : string
7+ readonly stackName : string
88 readonly collection : VectorCollection
99}
1010
@@ -15,7 +15,7 @@ export class VectorIndex extends Construct {
1515 constructor ( scope : Construct , id : string , props : VectorIndexProps ) {
1616 super ( scope , id )
1717
18- this . indexName = props . indexName
18+ this . indexName = ` ${ props . stackName } -index`
1919
2020 const indexMapping : CfnIndex . MappingsProperty = {
2121 properties : {
@@ -54,7 +54,7 @@ export class VectorIndex extends Construct {
5454
5555 const cfnIndex = new CfnIndex ( this , "MyCfnIndex" , {
5656 collectionEndpoint : props . collection . collectionEndpoint , // Use L2 property
57- indexName : props . indexName ,
57+ indexName : this . indexName ,
5858 mappings : indexMapping ,
5959 settings : {
6060 index : {
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ export class EpsAssistMeStack extends Stack {
8484 } )
8585
8686 const vectorIndex = new VectorIndex ( this , "VectorIndex" , {
87- indexName : "eps-assist-os-index" ,
87+ stackName : props . stackName ,
8888 collection : openSearchResources . collection
8989 } )
9090
You can’t perform that action at this time.
0 commit comments