File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -376,13 +376,13 @@ export class EpsAssistMeStack extends Stack {
376376 ]
377377 } )
378378
379- // ==== Lambda self-invoke policy (needed for Slack Bolt lazy handlers) ====
380- // const slackLambdaSelfInvokePolicy = new PolicyStatement({
381- // actions: ["lambda:InvokeFunction"],
382- // resources: [
383- // slackBotLambda.function.functionArn
384- // ]
385- // })
379+ // ==== IAM Policy for Lambda to invoke itself ====
380+ const lambdaSelfInvokePolicy = new PolicyStatement ( {
381+ actions : [ "lambda:InvokeFunction" ] ,
382+ resources : [
383+ `arn:aws:lambda: ${ this . region } : ${ this . account } :function: ${ slackBotLambda . function . functionName } `
384+ ]
385+ } )
386386
387387 // ==== Lambda environment variables ====
388388 const lambdaEnv : { [ key : string ] : string } = {
@@ -415,7 +415,7 @@ export class EpsAssistMeStack extends Stack {
415415
416416 // ==== Attach all policies to SlackBot Lambda role ====
417417 slackBotLambda . function . addToRolePolicy ( slackLambdaSSMPolicy )
418- // slackBotLambda.function.addToRolePolicy(slackLambdaSelfInvokePolicy )
418+ slackBotLambda . function . addToRolePolicy ( lambdaSelfInvokePolicy )
419419
420420 // ==== API Gateway & Slack Route ====
421421 const apiGateway = new RestApiGateway ( this , "EpsAssistApiGateway" , {
You can’t perform that action at this time.
0 commit comments