[Lambda DevX] Support for Config Hot Reloading #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Currently the configuration for Lambda Debug Mode is loaded on startup and cannot be changed until the next restart of LocalStack. This may not only be inconvenient whenever changes to the configuration may be required after startup, but also means that it is impossible for the user to provide configurations for Lambda functions for which the arn is unknown before startup. Such scenario may occur when using dynamic naming in cloud formation. Hence, these changes add initial support for the hot reloading of the Lambda Debug Mode configuration file. This is achieved by updating the config when changes are detected in the file, and stopping a lambda container after evaluation iff this is being debugged. Stopping the container after evaluation is encouraged by the difficulty/feasibility or reconfiguring the container (consider ports), and has the added benefit of unblocking the scenario of debugging the same lambda function more than once.
Changes
Testing
As the development of a testing stack for Lambdas debugging is being developed, I refer to manual testing using the Lambda Debug Mode sampled provided here: localstack-samples/localstack-pro-samples#253