1. 6
    Create and deploy a lambda function with AWS CDK
    4m 1s

Create and deploy a lambda function with AWS CDK

InstructorTomasz Łakomy

Share this video with your friends

Send Tweet

It's time to start building our serverless backend!

In this quick lesson we're going to use the lambda.Function construct imported from @aws-cdk/aws-lambda in order to build and deploy a 'Hello World!' AWS Lambda function.

You can find out more about what kind of constructs are available in AWS CDK construct library here

Olga Skurativska
Olga Skurativska
~ 7 months ago

Hey Tomasz, I think you forgot to mention, that before running cdk deploy you also have to run npm run build to compile the code in lambda folder. Otherwise, CDK will just upload just the TypeScript file and it's not going to work in AWS Lambda.

George
George
~ 5 months ago

I had to bootstrap before running cdk deploy. Once that completed I ran cdk deploy and no errors. The exact error message I was getting was: TodoappStack failed: Error: This stack uses assets, so the toolkit stack must be deployed to the environment (Run "cdk bootstrap aws://unknown-account/unknown-region")

Aaron Austin
Aaron Austin
~ 5 months ago

Thanks for this. It was really helpful to get started. One issue I had was using 3rd party node packages (I'm using FaunaDB) in my code. Somehow I missed the description of how to do this in a later lesson. After using my overcomplicated workaround, I found a much better way in lesson 22.

uwinkler
uwinkler
~ 5 months ago

The link to the code seems to be broken - I get a 404

Milan
Milan
~ 2 months ago

Link to code https://github.com/tlakomy/egghead-build-an-app-with-aws-cloud-development-kit/tree/create-a-lamba-function-with-cdk

Lauro Silva
Lauro Silva
~ 2 months ago

Link to code https://github.com/tlakomy/egghead-build-an-app-with-aws-cloud-development-kit/tree/create-a-lamba-function-with-cdk

Thanks for this @Milan! I got the code link updated! 🙌