-
Notifications
You must be signed in to change notification settings - Fork 88
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
Improvements to Lambda Development Experience #223
Comments
Here's also a link to blog post that also reasons about having this kind of feature in CDK directly: https://aripalo.com/blog/2020/building-lambda-functions-inside-docker-containers-with-cdk/ |
Thanks for filing this issue @aripalo. This is a very interesting idea, indeed. Building bett To implement your proposal or something similar, we'll need to think a little deeper into the customer experience of the CDK and what changes will be necessary across our toolchain (such as the CLI as you've noted in your blog post). I'm transferring this issue to our RFC repo, where we track changes and proposals that need deeper consideration. The RFC repo has a detailed entry on its process and I'm happy to guide you along the way, if you're interested in writing one. |
@nija-at Great to hear! This is definitely something that should not be implemented without thoughtful consideration first on how it should actually work; I just wanted to at least through the idea out there! I'll get in touch, if I'll hopefully get a change to think about this more soon and if I'd be able to contribute on the RFC more! |
Marking this RFCs as |
Now that AWS CDK can build Lambda functions within Docker containers by allowing to define
BundlingOptions
, it would be cool to have also the possibility to locally test, run arbitrary commands and locally invoke the Lambda function inside Docker as well.Use Case
Currently one has to come up with a separate toolchain to handle the local testing and locally invoking the Lambda function within Docker. I feel that these are critical steps in developing Lambda functions. Also having the possibility to run arbitrary commands within the build Docker container could be useful at times.
Proposed Solution
Currently one can define the build options like this:
It would be awesome if one could also specify the following (or something like it):
And then I could also imagine a CLI commands to be available after
synth
something like:cdk lambda test
to run tests for all functionscdk lambda test MyFunc
to run tests for specific functioncdk lambda invoke MyFunc --event some-payload.json
to build and then locally invoke the function codeOf course the above example assumes all CDK construct ID's regarding Lambda functions would be unique, which may not be the case. Then maybe one could use the Construct "path":
SomeConstruct/MyFunc
andAnotherConstruct/MyFunc
.Reasoning
Since CDK already has a lot functionality regarding running things inside the Docker container, it feels "unnecessary" to define totally separate toolchain for the testing/invocation; Having those essential development flows available via CDK would make CDK super powerful tool for building serverless projects.
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: