Create Your First API in AWS - 2022- API Gateway and Lambda in the console

Поділитися
Вставка
  • Опубліковано 15 гру 2024

КОМЕНТАРІ • 32

  • @babababa201
    @babababa201 Рік тому +1

    Absolute top quality content from this channel as always.

  • @youngzproduction7498
    @youngzproduction7498 Рік тому

    Your lesson saved my day. Thanks a lot.

  • @mickp3154
    @mickp3154 Рік тому

    @9:17 did you make a video with the DynameDB integration?? :D

  • @ChandlerKnowsBest
    @ChandlerKnowsBest 3 роки тому +1

    This was helpful!! I'm new to AWS. Is it ideal to create lambda function per endpoint when managing an API via API Gateway?

    • @CompleteCoding
      @CompleteCoding  3 роки тому

      You can create one lambda to handle all endpoints but there are a few disadvantages.
      1. The lambda needs all code for every endpoint. This means it takes longer to load on a cold start.
      2. All logs for every endpoint end up in the same place. If you want to find the last logs from a certain endpoint you have to find it in between all the rest. One lambda per endpoint means one log group per endpoint.
      3. You don't need to write any logic to read the event and decide which function to use. Less logic = less things to go wrong
      In my opinion one lambda per endpoint is the best way to go.

  • @programmusicuk
    @programmusicuk 3 роки тому

    Great Sam, nice to revisit this and refresh!

    • @CompleteCoding
      @CompleteCoding  3 роки тому

      Glad you enjoyed it!
      The console has changed so much that my original video (2nd ever video) was wrong.

  • @JohnVold
    @JohnVold 3 роки тому +2

    Very well explained, would love to see the DynamoDB integration as well :)

    • @CompleteCoding
      @CompleteCoding  3 роки тому +6

      That's a good idea. I can take the existing code and add dynamo reads and writes

    • @akillchetu4223
      @akillchetu4223 2 роки тому

      @@CompleteCoding if you have complete please share us.

    • @CompleteCoding
      @CompleteCoding  2 роки тому +2

      @@akillchetu4223 ua-cam.com/video/pp-5u6LB9K8/v-deo.html

    • @CompleteCoding
      @CompleteCoding  2 роки тому

      ua-cam.com/video/pp-5u6LB9K8/v-deo.html

  • @digitnomad
    @digitnomad 2 роки тому

    Great video! however, I think the easiest approach will be just node API in docker and host as function in cloud(AWS/Azure) reason is AWS services are using node. really is just node. code is more manageable after years. I wrote a workable serverless function in 2018 uses API/Lambda/DynamoDB, however, when I look at the code, I forget why was doing that way, funny thing is the code still working today.

    • @CompleteCoding
      @CompleteCoding  2 роки тому +1

      You definitely can just run a node app in ec2. But then you have to think about operations things too.
      What VPC am I in, what security group am I using, will the server cope if I get 10 requests a second, what if the server crashes, what if someone tries to hack my server.
      The great thing with serverless is that AWS handles all of that for you.
      I think if you didn't write a node server (assuming express) for 4 years then looked back at the code you'd forget why you did things that way too.
      If you use them regularly you build patterns and another dev that is familiar with Lambda should be able to quickly understand what you've done.

  • @andresm9051
    @andresm9051 3 роки тому

    Great video, I would like to ask you something off the video topic, can tou please recomend a resource or video to create an elasticsearch cluster for products management with dynamo stream.
    using Aws console or serverless framework but with security measures like a vpc for the cluster
    I appreciate any helpful comments

    • @CompleteCoding
      @CompleteCoding  3 роки тому

      This is something that I worked on once a very long time ago. We did it with the serverless framework as doing something of this complexity in the console is going to be frustrating to manage.
      I think it was put it together from a combination of articles. One for the VPC, one for elasticsearch and then another to connect to Dynamo streams. I don't know if there will be any videos or tutorials on how to set up everything.
      Sorry I can't be of more use

  • @ajr1247
    @ajr1247 2 роки тому

    Thank you so much for making these wonderful videos!

  • @orhn
    @orhn 2 роки тому

    Is this UI for Api Gateway new or old? Because this looks different than that i am able to see and looks a lot better

    • @CompleteCoding
      @CompleteCoding  2 роки тому

      I didn't film it that long ago so I hope it's the new one. You should have the ability to update your UI.

  • @ankitaburman5406
    @ankitaburman5406 2 роки тому

    Wow ...You explained it so well 👍👍👍👍 thank you so much ,one more question Sam can we add dependencies like express in the lambda ?

    • @CompleteCoding
      @CompleteCoding  2 роки тому

      Things get a bit more complex when you want to add an npm package.
      The easiest way is to lambda layer with it in. You put the npm package into a folder like this. nodejs/node_modules/express
      You then zip up the nodejs folder and upload it as a layer. Attach that layer to this lambda.

    • @ankitaburman5406
      @ankitaburman5406 2 роки тому

      @@CompleteCoding thank you for quick response ,by any chance have you covered the steps in any tutorials of yours ?

    • @CompleteCoding
      @CompleteCoding  2 роки тому +1

      @@ankitaburman5406 i'd actually forgotten that I'd made this video
      ua-cam.com/video/5a2LS7gNECk/v-deo.html

    • @ankitaburman5406
      @ankitaburman5406 2 роки тому

      @@CompleteCoding you are amazing.. 👍👍👍thank you so much

  • @khandoor7228
    @khandoor7228 3 роки тому

    Great content Sam. I would like to understand GSI's and queryStringParameters in more detail using serverless framework or api gateway. I want to be able to query an api with multiple parameters Any plans to do something with that?

    • @CompleteCoding
      @CompleteCoding  3 роки тому +1

      Great suggestion!
      queryStringParameters are pretty simple. API Gateway passes them straight through and are often used for things like "from" and "to" in date ranges or passing other parameters. It's what you do with them once they're in the Lambda that becomes useful.
      GSI are more complex. I have a video outlining what they are and how to use them. ua-cam.com/video/BNshfC0ZOqs/v-deo.html
      The really powerful thing is when you combine the two. You can enable a user to pass a query string parameter and then you query your GSI based on what parameter they sent you. I might add a video detailing an architecture that uses that.

    • @khandoor7228
      @khandoor7228 3 роки тому

      @@CompleteCoding Thanks Sam the other tricky part is how it is set up in the serverless.yml file.

    • @CompleteCoding
      @CompleteCoding  3 роки тому +1

      @@khandoor7228 Here's the structure to add a GSI to a dynamo tables. It uses serverless.ts but the structure is the same
      github.com/SamWSoftware/interviewAPI/blob/master/serverless/dynamodb.ts

  • @mrallg4866
    @mrallg4866 3 роки тому

    Great content but not that much views. Am a hipster or something ?

    • @CompleteCoding
      @CompleteCoding  3 роки тому +1

      It was only released a few hours ago. I'm not (yet) one of those mega-youtubers who gets 1 million views in a day.