-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: lambda vs code extension (#860)
* docs: lambda vs code extension * fix few nits * fix nits
- Loading branch information
1 parent
913882c
commit b76a21b
Showing
4 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+3.41 MB
...ser-guide/tools/lambda-tools/lambda-vscode-extension/deploy-lambda-function.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions
46
content/en/user-guide/tools/lambda-tools/lambda-vscode-extension/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: "Lambda VSCode Extension" | ||
weight: 9 | ||
description: > | ||
Deploy and invoke Lambda functions in LocalStack directly from VSCode | ||
--- | ||
|
||
## Introduction | ||
|
||
[LocalStack Lambda VSCode Extension](https://github.com/localstack/localstack-vscode-extension) supports deploying and invoking Python Lambda functions through [AWS SAM](https://github.com/aws/serverless-application-model) or [AWS CloudFormation](https://aws.amazon.com/cloudformation/resources/templates/). | ||
|
||
## Prerequisites | ||
|
||
- [VS Code](https://code.visualstudio.com/) | ||
- [`samlocal`](https://github.com/localstack/aws-sam-cli-local) command line wrapper around the [AWS SAM CLI](https://github.com/aws/aws-sam-cli) for use with [LocalStack](https://github.com/localstack/localstack). | ||
- [LocalStack](https://docs.localstack.cloud/getting-started/) running in the background. | ||
|
||
## Getting Started | ||
|
||
You can use a [sample project](https://github.com/joe4dev/lambda-python) to get started with the extension. The sample project contains a simple Lambda function and a SAM template. Clone the repository and open the project in VSCode. | ||
|
||
{{< command >}} | ||
$ git clone https://github.com/joe4dev/lambda-python.git | ||
$ cd lambda-python | ||
$ code . | ||
{{< /command >}} | ||
|
||
Install the [LocalStack VSCode Extension](https://marketplace.visualstudio.com/items?itemName=localstack.localstack) as recommended by the project. | ||
|
||
You can now open the Python handler function under `app/hello_world.py`. Click the CodeLens **Deploy Lambda function**, select the `template.yaml`, and choose a stack name such as `my-stack`. | ||
|
||
|
||
<img src="deploy-lambda-function.gif" alt="Deploying Lambda function via the VS Code Extension" title="Deploying Lambda function via the VS Code Extension" width="700" /> | ||
<br><br> | ||
|
||
|
||
Click the CodeLens **Invoke Lambda function** and pick the stack name `my-stack` and the function `hello-world-function`. | ||
|
||
|
||
<img src="invoke-lambda-function.gif" alt="Invoking Lambda function via the VS Code Extension" title="Invoking Lambda function via the VS Code Extension" width="700" /> | ||
<br> | ||
|
||
## Limitations | ||
|
||
- The CodeLens for **Deploy Lambda function** always appears at the first line of each Python file. | ||
- **Invoke Lambda function** currently only works in the region `us-east-1` and with an empty payload. |
Binary file added
BIN
+162 KB
...ser-guide/tools/lambda-tools/lambda-vscode-extension/invoke-lambda-function.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.