@@ -65,6 +65,11 @@ export class EpsAssistMeStack extends Stack {
6565 const deploymentRole = Role . fromRoleArn ( this , "deploymentRole" , deploymentRoleImport )
6666 const auditLoggingBucket = Bucket . fromBucketArn (
6767 this , "AuditLoggingBucket" , auditLoggingBucketImport )
68+ const assistMeDocumentSyncRole = Role . fromRoleArn (
69+ this ,
70+ "AssistMeDocumentSyncRole" ,
71+ assistMeDocumentSyncRoleArn
72+ )
6873
6974 if ( ! slackBotToken || ! slackSigningSecret ) {
7075 throw new Error ( "Missing required context variables. Please provide slackBotToken and slackSigningSecret" )
@@ -95,7 +100,8 @@ export class EpsAssistMeStack extends Stack {
95100 const storage = new Storage ( this , "Storage" , {
96101 stackName : props . stackName ,
97102 deploymentRole : deploymentRole ,
98- auditLoggingBucket : auditLoggingBucket
103+ auditLoggingBucket : auditLoggingBucket ,
104+ assistMeDocumentSyncRole : assistMeDocumentSyncRole
99105 } )
100106
101107 // initialize s3 folders for raw and processed documents
@@ -257,16 +263,6 @@ export class EpsAssistMeStack extends Stack {
257263 regressionTestRole . addManagedPolicy ( regressionTestPolicy )
258264 }
259265
260- // Grant Access to Document Sync Role
261- const assistMeDocumentSyncRole = Role . fromRoleArn (
262- this ,
263- "AssistMeDocumentSyncRole" ,
264- assistMeDocumentSyncRoleArn
265- )
266-
267- storage . kbDocsBucket . grantRead ( assistMeDocumentSyncRole )
268- storage . kbDocsKmsKey . grantDecrypt ( assistMeDocumentSyncRole )
269-
270266 // Output: SlackBot Endpoint
271267 new CfnOutput ( this , "SlackBotEventsEndpoint" , {
272268 value : `https://${ apis . apis [ "api" ] . api . domainName ?. domainName } /slack/events` ,
0 commit comments