Open
Description
Working my way through the Serverless example and had some feedback:
A Lambda should handle a single message type (combination of HTTP method and message), or at least Yan Cui thinks so and I do, too. ;)
Considering that CDK makes the management of Lambdas way easier than writing the CFT YAML oneself, let's have the Serverless example reflect those best practices by handling a single message type, which would give us the following Lambdas (in pseudocode for simplicity):
- getWidgets()
- getWidget(name)
- saveWidget(name) (Naming of this function reflects idempotency. This should also be an HTTP PUT, not a POST because it's idempotent. Could also be putWidget() if you like.)
- deleteWidget(name)