Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve deprecated Lambda debug docs #736

Merged
merged 2 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions content/en/user-guide/aws/lambda/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ If your Lambda function references a layer in real AWS, you can integrate it int
To grant access to your layer, run the following command:

{{< command >}}
$ aws lambda add-layer-version-permission
--layer-name test-layer
--version-number 1
--statement-id layerAccessFromLocalStack
--principal 886468871268
$ aws lambda add-layer-version-permission \
--layer-name test-layer \
--version-number 1 \
--statement-id layerAccessFromLocalStack \
--principal 886468871268 \
--action lambda:GetLayerVersion
{{< / command >}}

Expand Down
9 changes: 3 additions & 6 deletions content/en/user-guide/tools/lambda-tools/debugging/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ There, the necessary code fragments for enabling debugging are already present.
First, make sure that LocalStack is started with the following configuration (see the [Configuration docs]({{< ref "configuration#lambda" >}}) for more information):

{{< command >}}
$ LAMBDA_REMOTE_DOCKER=0 \
LAMBDA_DOCKER_FLAGS='-p 19891:19891' \
DEBUG=1 localstack start
$ LAMBDA_DOCKER_FLAGS='-p 19891:19891' localstack start
{{< /command >}}

#### Preparing your code
Expand Down Expand Up @@ -136,7 +134,7 @@ You can [follow the steps in the offical docs](https://www.jetbrains.com/help/py

#### Preparing your code

PyCharm provides a its own debugging package, called `pydevd-pycharm`. Essentially, you will add the following code to your lambda:
PyCharm provides its own debugging package, called `pydevd-pycharm`. Essentially, you will add the following code to your lambda:

```python
import pydevd_pycharm
Expand Down Expand Up @@ -284,7 +282,7 @@ lambda function.

### Configure LocalStack for remote Node.js debugging

`LAMBDA_REMOTE_DOCKER` has to be disabled, and `LAMBDA_DOCKER_FLAGS` needs to enable the debugger using `NODE_OPTIONS`:
Set the `LAMBDA_DOCKER_FLAGS` to enable the debugger using `NODE_OPTIONS`:

```yaml
#docker-compose.yml
Expand All @@ -294,7 +292,6 @@ services:
...
environment:
...
- LAMBDA_REMOTE_DOCKER=0
- LAMBDA_DOCKER_FLAGS=-e NODE_OPTIONS=--inspect-brk=0.0.0.0:9229 -p 9229:9229
```

Expand Down
Loading