|
1 | 1 | --- |
2 | 2 | title: "Hot Reloading" |
3 | | -date: 2021-09-27 |
4 | 3 | weight: 1 |
5 | 4 | description: > |
6 | 5 | Hot code reloading continuously applies code changes to Lambda functions |
7 | 6 | aliases: |
8 | 7 | - /user-guide/tools/lambda-tools/hot-reloading/ |
9 | 8 | --- |
10 | 9 |
|
| 10 | +## Introduction |
| 11 | + |
11 | 12 | Hot reloading (formerly known as hot swapping) continuously applies code changes to Lambda functions without manual redeployment. |
12 | 13 |
|
13 | 14 | Quickly iterating over Lambda function code can be quite cumbersome, as you need to deploy your function on every change. |
@@ -675,6 +676,24 @@ With the above example, you can make hot-reloading paths sharable between machin |
675 | 676 | One example for this are checked out git repositories, where the code is located in the same structure - the absolute location of the checked out repository on the machine might however differ. |
676 | 677 | If the chosen variable always points to the checked out directory, you can set the path using the placeholder in the checked out IaC template, or can share a Cloud Pod between machines. |
677 | 678 |
|
| 679 | +## Hot Reloading on LocalStack Web Application |
| 680 | + |
| 681 | +You can use the LocalStack Web Application to hot reload your Lambda functions. |
| 682 | +The [Lambda Resource Browser](https://app.localstack.cloud/inst/default/resources/lambda/functions) allows you to update your Lambda function and specify the file path for your Lambda code and dependencies. |
| 683 | + |
| 684 | +To set up Lambda Hot Reloading via the LocalStack Web Application: |
| 685 | + |
| 686 | +1. Navigate to the [Lambda Resource Browser](https://app.localstack.cloud/inst/default/resources/lambda/functions). |
| 687 | +2. Click **Create** to create a new Lambda function, or select **Update Function Code** for an existing Lambda function. |
| 688 | +3. In the **Code Source** section, choose **Hot Reload**. |
| 689 | +4. Enter the path to the directory containing your Lambda code for hot reloading. |
| 690 | +5. Click **Submit** to save the configuration. |
| 691 | + |
| 692 | +LocalStack will automatically set up the magic S3 bucket and the S3 key pointing to your specified file path. |
| 693 | +Changes to your Lambda code locally will be reflected immediately upon saving. |
| 694 | + |
| 695 | +<img src="hot-reload-lambda-web-app.png" alt="Setting Hot Reload on Web App" title="Setting Hot Reload on Web App" width="800px" /> |
| 696 | + |
678 | 697 | ## Useful Links |
679 | 698 |
|
680 | 699 | * [Lambda Code Mounting and Debugging (Python)](https://github.com/localstack/localstack-pro-samples/tree/master/lambda-mounting-and-debugging) |
|
0 commit comments