awsdocs / aws-cdk-guide

User guide for the AWS Cloud Development Kit (CDK).
Other
324 stars 221 forks source link

Serverless Example Lambdas Should Handle a Single Message Type #119

Open jkodroff opened 5 years ago

jkodroff commented 5 years ago

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):

ghost commented 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.

ghost commented 4 years ago

This example needs to be updated due to some API changes, so will try to get to it sooner rather than later.

ghost commented 4 years ago

Also according to a customer, there's a mismatch in the specified file locations.