How to Create an Authenticated REST API on AWS with API Gateway, Lambda, Cognito, & AWS Amplify

In this video I'll use the Amplify CLI to deploy a REST API backed by AWS Lambda and then connect to the API from a client-side project using React. I'll show how to configure the REST API to enable a Cognito Authorizer, only allowing authenticated requests to interact with the endpoint. I'll also show how to securely access the user's identity in the Lambda function event.
Here is some of the code I used: gist.github.com/dabit3/1f61f6...

Пікірлер: 73

  • @responseready7375
    @responseready73752 жыл бұрын

    How can I pull the cloudformation template from the cloud? Whenever I re-deploy my amplify project, the Authorizer is gone because it was not added to the template in the first place.

  • @Madeinchinaagain
    @Madeinchinaagain2 жыл бұрын

    Nowadays, Amplify encourages you to use Amplify to spin up your dev and production environment using the CLI. This means that most of your configuration should be done through the CLI so Amplify can keep track of different changes (to Cloudformation resources, I guess). Will Amplify "know" about the changes you do (e.g. setting up your API Gateway to use Authorizers) through the AWS Console UI?

  • @ApoorvMote
    @ApoorvMote3 жыл бұрын

    I was actually hoping to see same exact tutorial but backend (rest api, lambda, cognito) built with CDK instead of amplify cli

  • @toddtrowbridge5669
    @toddtrowbridge5669 Жыл бұрын

    Maybe consider saying log instead of “log out” when printing because you’re constantly saying “log out user” when printing user to the console

  • @Weagle1337
    @Weagle1337 Жыл бұрын

    Why when I update my API it deletes the Cognito Authorizer created from AWS Console?

  • @aoatom8244
    @aoatom82442 жыл бұрын

    default Authorization when restricting API with "add auth" by Cognito is "Auth: AWS IAM" ?

  • @nicolasp7997
    @nicolasp7997 Жыл бұрын

    how can i do the same with custom ui?

  • @markusspenninger6630
    @markusspenninger6630

    I guess amplify as a default export is deprecated and you would need to import it as a named export: import { Amplify } from 'aws-amplify'

  • @SzymonCFG
    @SzymonCFG2 жыл бұрын

    How can i use amplify to configure the api gateway authorizer? So i can make i repeatedly?

  • @jorgetovar621
    @jorgetovar621 Жыл бұрын

    How do you deploy updates to the lambda function?

  • @RaulNussbaum
    @RaulNussbaum Жыл бұрын

    This was super helpful in 2023; thank you so much!

  • @adR9990
    @adR99903 жыл бұрын

    Love that you were able to condense so much information in a short video, gw!

  • @chetanpatel1464
    @chetanpatel14643 жыл бұрын

    Thank you so much for doing videos like this. I've been learning amplify for the last 4 months using your videos to help me for projects at work. I'm just about to put my first app into production in the next couple of weeks

  • @m4monzter
    @m4monzter2 жыл бұрын

    Step by step and detailed video in reasonable span!! Thank you so much 🙌🏼

  • @miguel220369
    @miguel220369 Жыл бұрын

    Thank you, I spent 2 days looking for just this. Great video, straight to the point

  • @khandoor7228
    @khandoor72283 жыл бұрын

    Fantastic Nader, I have been exploring exactly this and you helped me out immensely! Thanks! I've been working a lot with Amplify and Amplify Admin (since its been out) and fine grained access has been interesting. I am tracking you and the team for all the content you can put out, so thanks a lot man!

  • @wreckuiem
    @wreckuiem2 жыл бұрын

    Incredible, spent a lot of time trying to find this material, thank you

  • @scottmanny
    @scottmanny2 жыл бұрын

    Thanks Nader, spent all day on this before finding your video.

  • @pemessh
    @pemessh2 жыл бұрын

    Wow. how come the freaking youtube algorithm did not suggest this video to me?

  • @acedpyre7190
    @acedpyre71903 жыл бұрын

    Thanks for this video, definitely got me a