Skip to content

Commit

Permalink
Fix #267 Mention the necessity of lambda:InvokeFunction permission in…
Browse files Browse the repository at this point in the history
… lazy listener document
  • Loading branch information
seratch committed Apr 9, 2021
1 parent efab010 commit 12ce26a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
22 changes: 21 additions & 1 deletion docs/_advanced/lazy_listener.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ pip install slack_bolt
# https://pypi.org/project/python-lambda/
pip install python-lambda

# Configure config.yml properly (AWSLambdaFullAccess required)
# Configure config.yml properly
# lambda:InvokeFunction & lambda:GetFunction are required for running lazy listeners
export SLACK_SIGNING_SECRET=***
export SLACK_BOT_TOKEN=xoxb-***
echo 'slack_bolt' > requirements.txt
Expand Down Expand Up @@ -90,4 +91,23 @@ def handler(event, context):
slack_handler = SlackRequestHandler(app=app)
return slack_handler.handle(event, context)
```

Please note that the followig IAM permissions would be required for running this example app.

```json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"lambda:InvokeFunction",
"lambda:GetFunction"
],
"Resource": "*"
}
]
}
```
</details>
3 changes: 2 additions & 1 deletion examples/aws_lambda/lazy_aws_lambda_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ handler: lazy_aws_lambda.handler
description: My first lambda function
runtime: python3.8
# role: lambda_basic_execution
role: bolt_python_lambda_invocation # AWSLambdaFullAccess
# Have lambda:InvokeFunction & lambda:GetFunction in the allowed actions
role: bolt_python_lambda_invocation

# S3 upload requires appropriate role with s3:PutObject permission
# (ex. basic_s3_upload), a destination bucket, and the key prefix
Expand Down

0 comments on commit 12ce26a

Please sign in to comment.