Skip to content

Commit dc6ac3d

Browse files
committed
Remove hash from resource names
1 parent bdb9228 commit dc6ac3d

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

packages/cdk/resources/OpenSearchResources.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {Construct} from "constructs"
22
import {OpenSearchCollection} from "../constructs/OpenSearchCollection"
33
import {Role} from "aws-cdk-lib/aws-iam"
4-
import {createHash} from "crypto"
54

65
export interface OpenSearchResourcesProps {
76
bedrockExecutionRole: Role
@@ -15,15 +14,13 @@ export class OpenSearchResources extends Construct {
1514
constructor(scope: Construct, id: string, props: OpenSearchResourcesProps) {
1615
super(scope, id)
1716

18-
// Create OpenSearch Serverless collection for vector storage
17+
// OpenSearch Serverless collection with vector search capabilities
1918
this.collection = new OpenSearchCollection(this, "OsCollection", {
20-
// Generate unique collection name with hash suffix (eps-assist-vector-db)
21-
collectionName: `eps-vec-db-${createHash("md5").update(this.node.addr).digest("hex").substring(0, 8)}`,
22-
// Grant access to Bedrock, Lambda, and account root
19+
collectionName: "eps-assist-vector-db",
2320
principals: [
24-
props.bedrockExecutionRole.roleArn,
25-
props.createIndexFunctionRole.roleArn,
26-
`arn:aws:iam::${props.account}:root`
21+
props.bedrockExecutionRole.roleArn, // Bedrock Knowledge Base access
22+
props.createIndexFunctionRole.roleArn, // Lambda index creation access
23+
`arn:aws:iam::${props.account}:root` // Account root access
2724
]
2825
})
2926
}

packages/cdk/resources/VectorKnowledgeBaseResources.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {Construct} from "constructs"
22
import {Role} from "aws-cdk-lib/aws-iam"
33
import {Bucket} from "aws-cdk-lib/aws-s3"
44
import {CfnKnowledgeBase, CfnGuardrail, CfnDataSource} from "aws-cdk-lib/aws-bedrock"
5-
import {createHash} from "crypto"
65

76
// Amazon Titan embedding model for vector generation
87
const EMBEDDING_MODEL = "amazon.titan-embed-text-v2:0"
@@ -23,7 +22,7 @@ export class VectorKnowledgeBaseResources extends Construct {
2322

2423
// Create Bedrock guardrail for content filtering
2524
this.guardrail = new CfnGuardrail(this, "Guardrail", {
26-
name: `eps-assist-guardrail-${createHash("md5").update(this.node.addr).digest("hex").substring(0, 8)}`,
25+
name: "eps-assist-guardrail",
2726
description: "Guardrail for EPS Assist Me Slackbot",
2827
blockedInputMessaging: "Your input was blocked.",
2928
blockedOutputsMessaging: "Your output was blocked.",
@@ -55,7 +54,7 @@ export class VectorKnowledgeBaseResources extends Construct {
5554

5655
// Create vector knowledge base for document retrieval
5756
this.knowledgeBase = new CfnKnowledgeBase(this, "VectorKB", {
58-
name: `eps-assist-kb-${createHash("md5").update(this.node.addr).digest("hex").substring(0, 8)}`,
57+
name: "eps-assist-kb",
5958
description: "Knowledge base for EPS Assist Me Slackbot",
6059
roleArn: props.bedrockExecutionRole.roleArn,
6160
knowledgeBaseConfiguration: {
@@ -83,7 +82,7 @@ export class VectorKnowledgeBaseResources extends Construct {
8382
// Create S3 data source for knowledge base documents
8483
new CfnDataSource(this, "S3DataSource", {
8584
knowledgeBaseId: this.knowledgeBase.attrKnowledgeBaseId,
86-
name: `eps-assist-s3-datasource-${createHash("md5").update(this.node.addr).digest("hex").substring(0, 8)}`,
85+
name: "eps-assist-s3-datasource",
8786
dataSourceConfiguration: {
8887
type: "S3",
8988
s3Configuration: {

0 commit comments

Comments
 (0)