dvsa / dvsa-lambda-starter

A starting pattern for AWS lambda in Typescript
MIT License
5 stars 4 forks source link

multiple lambdas with cloudwatch event #12

Closed SzymonKaczorowski-Kainos closed 4 years ago

SzymonKaczorowski-Kainos commented 4 years ago

Description

This PR removes the example lambda index.ts and replaces it with three new examples:

  1. get.ts - an example lambda for get requests
  2. post.ts - an example lambda for post requests
  3. cloudWatchEvent.ts - an example lambda for CloudWatch events

Related issue: RTA-12 Issue #2

Type of change

Checklist:

AnnaDodson commented 4 years ago

Is this work for #12 ? Can we make this Lambda a post endpoint to demonstrate a good request body handler

Andy-Taylor-92 commented 4 years ago

I think the idea is to place all handlers in the /src/handler/ directory with asrc/util/ and src/client/ directory for things like a logging/dynamoDB wrappers. Hopefully will clear this up with @sdh100shaun today :)

Andy-Taylor-92 commented 4 years ago

@sdh100shaun is this what you had envisioned?

Andy-Taylor-92 commented 4 years ago

@AnnaDodson the lambda has now been change to reflect a 'get' and 'post' handler :)

Andy-Taylor-92 commented 4 years ago

@sdh100shaun, @SzymonKaczorowski-Kainos - can you guys take a look at this PR to address issue #2 when you have time - i've added an example for a cloudwatch event. Sadly SAM CLI doesn't support testing a cloudwatch event locally via a schedule (can only be invoked manually)

SzymonKaczorowski-Kainos commented 4 years ago

@andytaylorkainos changes looks good to me :)

AnnaDodson commented 4 years ago

Can you update the description please and explain what these changes are

Andy-Taylor-92 commented 4 years ago

Can you update the description please and explain what these changes are

Done :)