File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -2,22 +2,26 @@ import {Construct} from "constructs"
22import { Key } from "aws-cdk-lib/aws-kms"
33import { S3Bucket } from "../constructs/S3Bucket"
44
5+ export interface StorageProps {
6+ readonly stackName : string
7+ }
8+
59export class Storage extends Construct {
610 public readonly kbDocsBucket : S3Bucket
711 public readonly kbDocsKey : Key
812
9- constructor ( scope : Construct , id : string ) {
13+ constructor ( scope : Construct , id : string , props : StorageProps ) {
1014 super ( scope , id )
1115
1216 // Create customer-managed KMS key for knowledge base document encryption
13- this . kbDocsKey = new Key ( this , "KbDocsKeyPr " , {
17+ this . kbDocsKey = new Key ( this , "KbDocsKey " , {
1418 enableKeyRotation : true ,
1519 description : "KMS key for encrypting knowledge base documents"
1620 } )
1721
1822 // Create S3 bucket for knowledge base documents with encryption
1923 this . kbDocsBucket = new S3Bucket ( this , "DocsBucket" , {
20- bucketName : "DocsPr" ,
24+ bucketName : ` ${ props . stackName } -Docs` ,
2125 kmsKey : this . kbDocsKey ,
2226 versioned : true
2327 } )
Original file line number Diff line number Diff line change @@ -50,7 +50,9 @@ export class EpsAssistMeStack extends Stack {
5050 // - Storage needs to exist first so IamResources can reference the S3 bucket for policies
5151 // - IamResources creates the Bedrock role that needs S3 access permissions
5252 // - KMS permissions are added manually after both constructs exist
53- const storage = new Storage ( this , "Storage" )
53+ const storage = new Storage ( this , "Storage" , {
54+ stackName : props . stackName
55+ } )
5456
5557 // Create IAM Resources
5658 const iamResources = new IamResources ( this , "IamResources" , {
You can’t perform that action at this time.
0 commit comments