AWS CDK Tutorial: Deploy a Python Lambda Function using AWS

Поділитися
Вставка
  • Опубліковано 4 січ 2025

КОМЕНТАРІ • 37

  • @harshitsinghai1395
    @harshitsinghai1395 Місяць тому

    what I like about pixegami is that he gives soo much useful information in short easy to understand video. This is exactly what I was looking for, and got this within 8min video.

  • @Patrick-hl1wp
    @Patrick-hl1wp 7 місяців тому +1

    clear explanation, thank you

    • @pixegami
      @pixegami  7 місяців тому

      Glad it was helpful!

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

    Great vid, im learning here :D

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

    Great video!

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

    I get an error "InvalidClientTokenId, security token included in the request is invalid" How do I fix this please?

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

      That probably means your credentials are invalid or expired. To understand how AWS credentials work, I suggest reading up on the "credential provider chain": docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html
      It basically means when you use AWS CLI or an SDK inside an app, there is a priority list of where it looks for your credentials. The one it found in your case appeared to be invalid.
      You might need to refresh your access keys: docs.aws.amazon.com/powershell/latest/userguide/pstools-appendix-sign-up.html

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

      @@pixegami Thank you for the reply! It worked once I connected MFA

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

    btw what does -e . does in the requirements.txt file? pardon me if its a dumb question..

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

    Minute 4:20, why did you copy something and pasted something different?

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

      Had to watch it again since it's been a while since I made that video :P I think I was just highlighting the part in the doc that links to the AWS CDK, but the code editor I pasted the actual line you need to import to make it work.

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

      @@pixegami ok xD, thanks

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

    How does your VSCode do CDK syntax autocomplete?

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

      These days I use GitHub co-pilot, which is really good at auto-complete. But on this video, Co-Pilot wasn't released yet - so if it looks like I'm autocompleting, it just might be from the video edit where I cut out my typing to speed up the content?

  • @unknown3713
    @unknown3713 6 місяців тому

    hi, this is really a good video but, I followed same steps but I am getting import module error inside lambda function, how to resolve this, please help

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

    Thank you! 👍

  • @shafiqrezal2855
    @shafiqrezal2855 7 місяців тому +1

    Is this video still okay? or there is new way of doing deployment IAAS?

    • @pixegami
      @pixegami  7 місяців тому

      Video still works in general (AWS technology tends to be maintained for a long time), but the newer versions of CDK might have slightly different syntax, or make things a bit easier for you.
      This is a more recent video I have for making an API: ua-cam.com/video/RGIM4JfsSk0/v-deo.html

    • @shafiqrezal2855
      @shafiqrezal2855 7 місяців тому

      @@pixegami thanks 🙏

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

    WHat is that awesome terminal :O

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

      This is just the regular Linux terminal program. I use z-shell (zsh) instead of bash. With zsh, I have the “oh-my-zsh” plugin, with the “Agnoster” theme (but I changed some colours). I also added an ‘auto-complete’ plugin so I don’t have to remember all of my commands.

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

    your content is amazing man, ever considerer lauch a paid course focused on AWS (for data pipelines for example)? i am very interested, keep up the awesome work! thank you so much for all the content

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

      I do these videos as a hobby so I'm not really thinking about doing it as a paid course at this point. But if my viewers want more AWS stuff, I'm happy to work on a playlist for them :)

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

    Another great video.
    Just to add, I followed along on the 2023/9/10.
    I'm guessing we are now fully on CDK v2. So I had to modify the apigateway bit as the modules have changed.
    I used this instead (just to get this working: there might be a better way using HTTP API, but REST was the quickest):
    from aws_cdk.aws_apigateway import LambdaRestApi
    def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
    super().__init__(scope, construct_id, **kwargs)
    random_drink_lambda = aws_lambda.Function(
    self,
    id="RandomDrinkFunctionV2",
    code=aws_lambda.Code.from_asset("./first_project/compute/"),
    handler="random_drink.lambda_handler",
    runtime=aws_lambda.Runtime.PYTHON_3_10
    )
    LambdaRestApi(
    self, 'Drinkspot',
    handler=random_drink_lambda
    )
    Also, the requirements.txt that comes with cdk --init has packages that contain lambda, so you don't need to do it the way it is done in this video.

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

      Thanks! It's been a while since I did this video - I was new to it at the time. Also, CDK has changed quite a bit since then. Maybe it's time for me to do an updated version of this tutorial :)

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

      @@pixegami If you do, I'd suggest putting it as its own playlist. So that way people can do a follow along in sequence.
      AWS changes a lot, I don't even bother with older videos > 1 year. I really needed to learn CDK, and this is by far the best one I have come across on the net.
      Previoulsy the CDK Workshop site was my main training area, but I really didn't know what I was doing as I was just copying commands to build something too "complex".
      Your one is simple Lambda and API Gateway; much easier to follow the code and what is created where and why, etc
      And mind you the slight deviation probably paid more from a learning perspective as it really forced me to think!
      But anyway good work!

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

    is this API deployed in this manner private or public?

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

      This is a public API. But you can always add authentication to it.

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

    Again, thank you very much. I would greatly appreciate it if you please activate the subtitles in the videos. 😉

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

      Thanks for the suggestion! I'll look into how to add subtitles.

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

      @@pixegami thank you friend for your generosity

  • @ttaylor9916
    @ttaylor9916 3 місяці тому

    great video.. but some key details were not discussed.. getting lost...

    • @ttaylor9916
      @ttaylor9916 3 місяці тому

      could not install cdk in dir for previous tutorial... had to be an empty dir... now not quite figuring out your file struction in this tutorial.....

    • @pixegami
      @pixegami  2 місяці тому

      Yeah, thanks for the feedback! Sorry if some parts weren't clear. Let me know which key details weren't clear, so I can make sure to include them for next time!