Skip to content

Serverless Example Lambdas Should Handle a Single Message Type #119

Open
@jkodroff

Description

@jkodroff

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions