File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export interface RuntimePoliciesProps {
1616 readonly knowledgeBaseArn : string
1717 readonly guardrailArn : string
1818 readonly dataSourceArn : string
19+ readonly promptName : string
1920}
2021
2122export class RuntimePolicies extends Construct {
@@ -63,7 +64,10 @@ export class RuntimePolicies extends Construct {
6364
6465 const slackBotPromptPolicy = new PolicyStatement ( {
6566 actions : [ "bedrock:GetPrompt" ] ,
66- resources : [ `arn:aws:bedrock:${ props . region } :${ props . account } :prompt/*` ]
67+ resources : [
68+ `arn:aws:bedrock:${ props . region } :${ props . account } :prompt/${ props . promptName } ` ,
69+ `arn:aws:bedrock:${ props . region } :${ props . account } :prompt/${ props . promptName } :*`
70+ ]
6771 } )
6872
6973 const slackBotKnowledgeBasePolicy = new PolicyStatement ( {
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ export class EpsAssistMeStack extends Stack {
9494 account
9595 } )
9696
97- // Create runtime policies that depend on VectorKB ARNs
97+ // Create runtime policies with resource dependencies
9898 const runtimePolicies = new RuntimePolicies ( this , "RuntimePolicies" , {
9999 region,
100100 account,
@@ -104,7 +104,8 @@ export class EpsAssistMeStack extends Stack {
104104 slackBotStateTableKmsKeyArn : tables . slackBotStateTable . kmsKey . keyArn ,
105105 knowledgeBaseArn : vectorKB . knowledgeBase . attrKnowledgeBaseArn ,
106106 guardrailArn : vectorKB . guardrail . attrGuardrailArn ,
107- dataSourceArn : vectorKB . dataSourceArn
107+ dataSourceArn : vectorKB . dataSourceArn ,
108+ promptName : bedrockPrompts . queryReformulationPrompt . promptName
108109 } )
109110
110111 // Create Functions construct with actual values from VectorKB
You can’t perform that action at this time.
0 commit comments