You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/aws_lambda/README.md
+32-38Lines changed: 32 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,8 @@ This directory contains two example apps. Both respond to the Slash Command
4
4
`/hello-bolt-python-lambda` and both respond to app at-mentions.
5
5
6
6
The "Lazy Lambda Listener" example is the simpler application and it leverages
7
-
AWS Lambda and AWS API Gateway to execute the Bolt app logic in Lambda and
8
-
expose the application HTTP routes to the internet via API Gateway. The "OAuth
7
+
AWS Lambda and AWS Lambda Function URL to execute the Bolt app logic in Lambda and
8
+
expose the application HTTP routes to the internet via Lambda URL. The "OAuth
9
9
Lambda Listener" example additionally includes OAuth flow handling routes and uses
10
10
AWS S3 to store workspace installation credentials and OAuth flow state
11
11
variables, enabling your app to be installed by anyone.
@@ -49,33 +49,28 @@ Instructions on how to set up and deploy each example are provided below.
49
49
Lambda there.
50
50
8. While your Lambda exists, it is not accessible to the internet, so Slack
51
51
cannot send events happening in your Slack workspace to your Lambda. Let's
52
-
fix that by adding an AWS API Gateway in front of your Lambda so that your
52
+
fix that by adding an AWS Lambda Function URL to your Lambda so that your
53
53
Lambda can accept HTTP requests:
54
54
- Click on your `bolt_py_function` Lambda
55
-
- In the Function Overview, on the left side, click "+ Add Trigger"
56
-
- Select API Gateway from the trigger list
57
-
- Make sure "Create an API" is selected in the dropdown, and choose "HTTP API"
58
-
as the API Type
59
-
- Under Security, select "Open"
60
-
- Click "Add"
61
-
9. Congrats! Your Slack app is now accessible to the public. On the left side of
62
-
your `bolt_py_function` Function Overview you should see a purple API Gateway
63
-
icon. Click it.
64
-
10. Click Details to expand the details section.
65
-
11. Copy the API Endpoint - this is the URL your Lambda function is accessible
66
-
at publicly.
67
-
12. We will now inform Slack that this example app can accept Slash Commands.
55
+
- In the Function Overview click "Configuration"
56
+
- On the left side, click "Function URL"
57
+
- Click "Create function URL"
58
+
- Choose auth type "NONE"
59
+
- Click "Save"
60
+
9. Congrats! Your Slack app is now accessible to the public. On the right side of
61
+
your `bolt_py_function` Function Overview you should see your Lambda Function URL.
62
+
10. Copy this URL to your clipboard.
63
+
11. We will now inform Slack that this example app can accept Slash Commands.
68
64
- Back on api.slack.com/apps, select your app and choose Slash Commands from the left menu.
69
65
- Click Create New Command
70
66
- By default, the `lazy_aws_lambda.py` function has logic for a
71
67
`/hello-bolt-python-lambda` command. Enter `/hello-bolt-python-lambda` as
72
68
the Command.
73
-
- Under Request URL, paste in the previously-copied API Endpoint from API
74
-
Gateway.
69
+
- Under Request URL, paste in the previously-copied Lambda Function URL.
75
70
- Click Save
76
-
13. Test it out! Back in your Slack workspace, try typing
71
+
12. Test it out! Back in your Slack workspace, try typing
77
72
`/hello-bolt-python-lambda hello`.
78
-
14. If you have issues, here are some debugging options:
73
+
13. If you have issues, here are some debugging options:
79
74
- Check the Monitor tab under your Lambda. Did the Lambda get invoked? Did it
80
75
respond with an error? Investigate the graphs to see how your Lambda is
81
76
behaving.
@@ -172,30 +167,29 @@ export
172
167
6. Let's deploy the Lambda! Run `./deploy_oauth.sh`. By default it deploys to the us-east-1 region in AWS - you can customize this in `aws_lambda_oauth_config.yaml`.
173
168
7. Load up AWS Lambda inside the AWS Console - make sure you are in the correct region that you deployed your app to. You should see a `bolt_py_oauth_function` Lambda there.
174
169
175
-
### Set up AWS API Gateway
176
-
Your Lambda exists, but it is not accessible to the internet, so Slack cannot yet send events happening in your Slack workspace to your Lambda. Let's fix that by adding an AWS API Gateway in front of your Lambda so that your Lambda can accept HTTP requests
170
+
### Set up AWS Lambda Function URL
171
+
Your Lambda exists, but it is not accessible to the internet, so Slack cannot yet send events happening in your Slack workspace to your Lambda. Let's fix that by adding an AWS Lambda Function URL to your Lambda so that your Lambda can accept HTTP requests
177
172
178
173
1. Click on your `bolt_py_oauth_function` Lambda
179
-
2. In the **Function Overview**, on the left side, click "+ Add Trigger"
180
-
3. Select "API Gateway" from the trigger list
181
-
4. Make sure "Create an API" is selected in the dropdown, and choose "HTTP API" as the API Type
182
-
5. Under Security, select "Open"
183
-
6. Click "Add"
184
-
185
-
Phew, congrats! Your Slack app is now accessible to the public. On the left side of your bolt_py_oauth_function Function Overview you should see a purple API Gateway icon. Click it.
186
-
187
-
1. Click "Details"
188
-
2. Copy the API Endpoint - this is the URL your Lambda function is accessible at publicly.
189
-
3. We will now inform Slack that this example app can accept Slash Commands.
190
-
4. Back on [api.slack.com/apps](https://api.slack.com/apps), select your app and choose "Slash Commands" from the left menu.
191
-
5. Click "Create New Command"
174
+
2. In the **Function Overview**, on the left side, click "Configuration
175
+
3. On the left side, click "Function URL"
176
+
4. Click "Create function URL"
177
+
5. Choose auth type "NONE"
178
+
6. Click "Save"
179
+
180
+
Phew, congrats! Your Slack app is now accessible to the public. On the right side of your bolt_py_oauth_function Function Overview you should see a your Lambda Function URL.
181
+
182
+
1. Copy it - this is the URL your Lambda function is accessible at publicly.
183
+
2. We will now inform Slack that this example app can accept Slash Commands.
184
+
3. Back on [api.slack.com/apps](https://api.slack.com/apps), select your app and choose "Slash Commands" from the left menu.
185
+
4. Click "Create New Command"
192
186
1. By default, the `aws_lambda_oauth.py` function has logic for a /hello-bolt-python-lambda command. Enter `/hello-bolt-python-lambda` as the Command.
193
-
* Under **Request URL**, paste in the previously-copied API Endpoint from API Gateway.
187
+
* Under **Request URL**, paste in the previously-copied Lambda Function URL.
194
188
* Click "Save"
195
-
6. We also need to register the API Endpoint as the OAuth redirect URL:
189
+
5. We also need to register the API Endpoint as the OAuth redirect URL:
196
190
1. Load up the **OAuth & Permissions** page on[api.slack.com/apps](https://api.slack.com/apps)
197
191
2. Scroll down to "Redirect URLs"
198
-
3. Copy the API endpoint in - but remove the path portion. The Redirect URL needs to only partially match where we will send users.
192
+
3. Copy the URL endpoint in - but remove the path portion. The Redirect URL needs to only partially match where we will send users.
0 commit comments