Setup AWS Serverless Project with Typescript Lambda Functions

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ต.ค. 2024

ความคิดเห็น • 51

  • @CodeDunks
    @CodeDunks  3 ปีที่แล้ว

    Assumption was that AWS may have been configured on your machine already. But if not you can quickly follow along here: documentationnerds.com/blog/tech/configure-aws-cli

    • @tdelam
      @tdelam 2 ปีที่แล้ว +1

      Site is offline for me atm.

  • @mosespeter9711
    @mosespeter9711 2 ปีที่แล้ว +3

    This is undoubtably the best serverless video on internet

  • @tarunhasija4751
    @tarunhasija4751 ปีที่แล้ว

    After investing over 48 hours into learning about serverless from various sources and blogs, I was surprised to find that this video managed to encapsulate the entire topic in just under 30 minutes. Outstanding job, Leo!

  • @seeds_of_growth-yi5gx
    @seeds_of_growth-yi5gx ปีที่แล้ว

    Thanks a lot, for being on-point and touching upon important parts of the topic.
    On the debug section, in the run configs, the "protocol" is not longer supported, and for me it was just exiting with 1
    so I added the --verbose flag to know what's going on, and just adding --verbose as follows, solved the problem and the debugger works great!
    "args": ["offline", "start", "--httpPort", "4000", "--noTimeout", "--verbose"],
    Cheers!

  • @supa1009
    @supa1009 3 ปีที่แล้ว +1

    bro you are my hero, this tutorial really helped me to deploy my existing project!

    • @CodeDunks
      @CodeDunks  3 ปีที่แล้ว +1

      Glad I could help!

  • @LodkaGG
    @LodkaGG 7 หลายเดือนก่อน

    Thank you very much man, you teaching so clearly, that's cool for sure

  • @iamdhison
    @iamdhison 2 ปีที่แล้ว +1

    Amazing video bro.
    I am struggling to debug typescript aws cdk lambda.
    It will be very great if you post video for that as well.

  • @betheleyo2701
    @betheleyo2701 4 หลายเดือนก่อน

    Good work, but you missed explaining all the permissions in an aws iam policy file that is needed to be able to run a successful "serverless deploy" command, it took me a while to have that set up

  • @khandoor7228
    @khandoor7228 3 ปีที่แล้ว +2

    Great tutorial Leo, I use a lot of AWS + Serverless would love to see more, especially queryStringParameters with Lambdas and Dynamo tables. If you could do a video on pathParameters for pagination and searching by queryStringParameters I think would be awesome. just an idea.

    • @CodeDunks
      @CodeDunks  3 ปีที่แล้ว +1

      Thanks, KhanDoor! Yeah, I personally love using Serverless, I hope to eventually get to learn about those things you mentioned and if I do I will be sure to make a video on it!

  • @mugdhawadhokar1071
    @mugdhawadhokar1071 5 หลายเดือนก่อน

    hey great video. Here I am confuse about invcocation API, why does it generates and can we avoid it from generating ?

  • @VINODMAKKENA-e7q
    @VINODMAKKENA-e7q 3 หลายเดือนก่อน

    Very helpful. Thank you

  • @guillermovillalta6322
    @guillermovillalta6322 2 ปีที่แล้ว

    Just got a new subscriber, great content. This is awesome!

  • @toan_tan
    @toan_tan 2 ปีที่แล้ว +1

    Hi, Very useful video. Thank you a lot! 😄

  • @dontdoit6986
    @dontdoit6986 3 ปีที่แล้ว

    Dude Amazing! Great video. Super helpful!
    Question: feelings on terraform?

    • @CodeDunks
      @CodeDunks  3 ปีที่แล้ว

      Thanks Christopher, my feelings is that I wish I had more time to be able to get my hands dirty with it haha. I've heard good things about it though!

  • @seeds_of_growth-yi5gx
    @seeds_of_growth-yi5gx ปีที่แล้ว

    Why in the hello arg is _event, and goodbye is just event without underscore ?

  • @lowkeygaming4716
    @lowkeygaming4716 2 ปีที่แล้ว

    Is it okay to use the lambda without using the APi Gateway too? And does lambda support Class based node js app?

  • @glenjensen3683
    @glenjensen3683 3 ปีที่แล้ว +1

    I'm experiencing a peculiar error, and I'm hoping that you might have seen the same one. When I run local testing, everything works fine with imported modules. But when I deploy it to lambdas, any handler that use a library from a separate file will crash with "cannot find module as if dependencies aren't being installed. However any dependencies directly in a handler file works just fine.

    • @CodeDunks
      @CodeDunks  3 ปีที่แล้ว +1

      Hey Glen, when you say a library from a separate file what do you mean? For example, if you have this lambda project as a sub repository and are accessing another sub repositories interface then this is expected. The reason for that is that serverless will only package up the lambda projects files. So locally it works because it can access the "other library" on your local machine, but that "other library" does not exist within the package on AWS. This link might be of some use also
      aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-nodejs/

    • @glenjensen3683
      @glenjensen3683 3 ปีที่แล้ว +1

      ​@@CodeDunks Hello Leo, from further investigation I can see that it is just any node module that cannot be found. Which perplexes me greatly, as I've followed the same structure as you have. From the link you send, do I understand correctly that this article wants me to change my code structure to have functions in root with package.json?

    • @CodeDunks
      @CodeDunks  3 ปีที่แล้ว

      @@glenjensen3683 Hmm that is odd. Couple of things you can try.
      1) run yarn install again to make sure dependencies are installed correctly
      2) run "yarn sls package -s dev" then check in your .serverless folder in the root of your current directory for your projects generated zip, then within that zip see that node_modules is in there with whatever dependency it says that it's missing.
      3) If all else fails, try possibly copying the project from my repo in the description and see if that works.

  • @andrewdelmonte1172
    @andrewdelmonte1172 2 ปีที่แล้ว

    This is dope man thank you

  • @ashrutinayak4079
    @ashrutinayak4079 2 ปีที่แล้ว

    @leo Roese can you Please guide me? I am confused in two type serverless project build one HTTP API nodejs and express API node. what's different in that and when we create http api nodejs project and when we create express api nodejs project?

  • @xmaxfuture
    @xmaxfuture 2 ปีที่แล้ว

    i get a "message": "Bad request", code: 400.
    i cant find the solution

  • @xukhanh
    @xukhanh 3 ปีที่แล้ว +1

    How can I setup the command 'template-cli' like you do? Would you mind share some tutorial about it?

    • @CodeDunks
      @CodeDunks  3 ปีที่แล้ว

      Hey there you can look at either my video or article I made about it.
      Video: th-cam.com/video/xYko2bHNgVA/w-d-xo.html
      Article: documentationnerds.com/blog/tech/template-cli-with-node-and-inquirer

  • @76Freeman
    @76Freeman 3 ปีที่แล้ว

    Hi Leo,
    Great video, I've just stepped in the land of Serverless :) and your video was of great help. I'm wondering if you've ever used it in conjunction with Hasura?
    Thank you again

    • @CodeDunks
      @CodeDunks  3 ปีที่แล้ว +1

      I have not had the chance to use Hasura but I have heard good things about it.

    • @76Freeman
      @76Freeman 3 ปีที่แล้ว

      ​@@CodeDunks I'm actually working with it right now and I need to create a user when a user confirms his signup. Do you know I could test a lambda that is triggered when the user confirms the signup.
      Right now I'm getting an error "Unrecognizable lambda output"
      This is my lambda:
      import { GraphQLClient } from 'graphql-request';
      import { Callback, Context } from 'aws-lambda';
      const adminSecret = process.env.ADMIN_SECRET;
      const hgeEndpoint = process.env.HGE_ENDPOINT;
      export const handler = async (event: any, context: Context, callback: Callback): Promise => {
      try {
      const headers = {
      headers: {
      'x-hasura-admin-secret': adminSecret as string,
      },
      };
      const graphqlClient = new GraphQLClient(hgeEndpoint as string, headers);
      const qv = {
      email: event.request.userAttributes.email,
      };
      await graphqlClient.request(
      `mutation InsertUser($user: users_insert_input!) {
      insert_users_one(object: $user) {
      id
      }
      }`,
      qv
      );
      callback(null, event);
      } catch (e) {
      console.warn('error', e);
      callback(null, false);
      }
      };

  • @ajithxyz
    @ajithxyz 2 ปีที่แล้ว

    Hi- Is there a way you can add a lambda layer demo as well?

  • @sahej97
    @sahej97 3 ปีที่แล้ว

    Nice intro and tutorial

  • @lcrazyvinil
    @lcrazyvinil 3 ปีที่แล้ว

    Using AWS lambda I'll have a lot of external IPs? I need an cheap solution to run my API with a lot of external IPs.

    • @CodeDunks
      @CodeDunks  3 ปีที่แล้ว

      I am not entirely sure what is being asked here. Could you elaborate?

  • @glenjensen3683
    @glenjensen3683 3 ปีที่แล้ว

    as Luke as all ready requested, could you please do a quick addition or just foot note to this video where you talk about how to have each Lambda be self contain and deployable on it's own as well as having a parent template that imports all others, giving the option to either deploy all Lambdas at once or just a single Lambda. It is something that I see a lot of projects that grow in size require, but often hit a road block on as they are all written with the intent to deploy all Lambdas at once.

    • @CodeDunks
      @CodeDunks  3 ปีที่แล้ว

      Oh I haven't quite come across that recently. I will try and get around to it if I can!

  • @lukewyman1
    @lukewyman1 3 ปีที่แล้ว

    Show us how to do a multi-module (like, a serverless.yml and package.json for each module, where what goes in common vs each module, that kinda thing). Pleez, pretty pleez?
    Also, any thoughts for chosing between mocha and jest? I was going to go with mocha, as it seems to have larger market share (maybe?), but I'm seeing that coverage, expect, etc for mocha has additional dependencies, like chai and istanbul to install, and configuration doesn't look as easy and breezy as with jest.

    • @CodeDunks
      @CodeDunks  3 ปีที่แล้ว +1

      I've worked with both mocha and jest and found that the overall experience with Jest is a lot better in my own personal opinion. Every industry position I've worked on has also used Jest

  • @ChrisTian-ox5nr
    @ChrisTian-ox5nr 2 ปีที่แล้ว

    Legend!

  • @SkriptKid
    @SkriptKid ปีที่แล้ว

    Awesome vid. Subbed!

  • @Rekefa
    @Rekefa 3 ปีที่แล้ว

    What a great terminal, do you have the config files for it?

    • @CodeDunks
      @CodeDunks  3 ปีที่แล้ว

      Hey Rekefa, I actually just got a new computer and therefore don't have the configs yet. But here is the article I used to kinda set it up. Its a combination of windows terminal and cmder.
      medium.com/talpor/windows-terminal-cmder-%EF%B8%8F-573e6890d143

    • @Rekefa
      @Rekefa 3 ปีที่แล้ว

      @@CodeDunks Thank you very much!

  • @alanrodriguezw.9149
    @alanrodriguezw.9149 2 ปีที่แล้ว

    Thanks You!!

  • @igoralves1
    @igoralves1 2 ปีที่แล้ว

    Have been working with serverless some yrs now. Do not mix serverless concept and microservices. There are some microservices written in nodejs in a ec2 container that are not serverless and there are some serverless system that are not microservices at all. And there are some real serverless microservices and on top of this concepts there are lambdas vs non lambdas microservices and also lambdas that are restful apis or a simple lambda with no endpoint....also that brings the idea of Functional paradigm vs oop in lambdas/serverless/microservices approach....

  • @limpep
    @limpep 6 หลายเดือนก่อน

    s3 triggers, schedulers

  • @HughHopkins
    @HughHopkins 2 ปีที่แล้ว

    Great video, thank you so much