Open jkodroff opened 5 years ago
@jkodroff Thanks for your suggestion! Refactoring as you suggest isn't a bad idea, and it's important to model best practices. Still, the current approach has the advantage of being as simple as possible from the CDK side, which has its merits. I'll leave this in the hopper, since we do want to beef up the examples, but I can't make any promises on when I'll get to it.
This example needs to be updated due to some API changes, so will try to get to it sooner rather than later.
Also according to a customer, there's a mismatch in the specified file locations.
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):