I am really impressed that with just a single line of code we can turn a webapi application into a serverless lambda. nice work from AWS team
@Dustyy012 жыл бұрын
Whats rly funny is that Nick does so much for Microsoft in general. Microsoft: 👀 Amazon: Lets give this man some money
@nickchapsas2 жыл бұрын
Honestly AWS is the best sponsor I ever had. I've been using them for the past 3 years professionally and they've been constantly improving and investing in their .NET support and SDKs. Really glad they support .NET content creation.
@Dustyy012 жыл бұрын
@@nickchapsas For sure, I mean the simple abstractions they provide in addition to their libraries are so convenient and show that they really want devs to use their stuff
@gravious2 жыл бұрын
i just got a job writing REST APIs with Lambda, this video is the perfect primer. You rock Nick! :D
2 жыл бұрын
I had to step back a bit to grab this concept: "Serverless is a cloud-native development model that allows developers to build and run applications without having to manage servers. There are still servers in serverless, but they are abstracted away from app development."
@nagarajansubramani2 жыл бұрын
Exactly! For this reason, I wished Serverless were termed Serverblind instead. Oh well 🤷♂️
2 жыл бұрын
@@nagarajansubramani I'm in IT for 35 years and keep hearing new terms that make me look like an idiot. I wish we could try more in using amalgam of basic terms - Serverblind is quite intuitive so is server independent or server with normalized api module to connect to.
@parlor31152 жыл бұрын
Are Lambdas (and their equivalents from other providers) the only way to do serverless through?
@Kazi28122 жыл бұрын
@@parlor3115 Azure Functions are the same. A much more intuitive name.
@MrOboema2 жыл бұрын
@@Kazi2812 Really? Azure Functions sounds like a chapter in a book that summerizes what Azure can be used for, meant for non-techies 😁
@petkopetkov42302 жыл бұрын
You are an alien man. Writing and speaking without any hesitation, just phenomenal. Kudos!
@Code_Bits2 жыл бұрын
I've build many API's like this but not using AWS Lambdas, but Azure Functions. It's indeed dirt cheap, you can even set up availablitiy checks for your API's and log everything while barely spending money.
@TopLel1232 жыл бұрын
Could you make a video or leave a comment about how you find new things to learn/what resource you use/what you follow and what's your proceess for learning new things? I'd be really interested because it always seems like you're on top of everything. Thank you!
@PereViader2 жыл бұрын
You are a legend. "Let's go ahead and add 60 and 9"
@raghavgupta11572 жыл бұрын
Nice
@michaelkurzewski29372 жыл бұрын
AWS sponsorship! Big things! :) All the best on your new career path!
@vaibhavmor18682 жыл бұрын
Thanks! Do you plan on releasing a REST API course ? Love your previous three courses.
@nickchapsas2 жыл бұрын
I do plan on release a course on REST yes. It will probably be the one after the Integration testing one that will launch late May/early June
@vaibhavmor18682 жыл бұрын
@@nickchapsas thank you!
@Xblade-Dev2 жыл бұрын
Thanks for doing this in Rider, the best IDE :)
@BrunoJuliao72 жыл бұрын
All the videos you suggested sounds cool. I would enjoy watching them 😇
@Marcel-dt5du2 жыл бұрын
Would really love to see a comparison between durable Azure Functions vs AWS step functions. I think the AWS part would nicely complement this video.
@olegkot33622 жыл бұрын
Could you show something like this via Azure?
@nickchapsas2 жыл бұрын
I haven't used Azure Functions in 3 years so I don't know for sure.
@butchakakakopf26012 жыл бұрын
Yes, here is a wish too.
@Rubacava_2 жыл бұрын
It's really easy with vscode azure functions extension. It creates the boilerplate code for you. All you need is to paste your function and hit deploy.
@nickchapsas2 жыл бұрын
@@Rubacava_ So you can take a full ASP.NET Core project and deploy it as an API in Azure Functions? Because that's what they are asking.
@jinalpatel91542 жыл бұрын
@@nickchapsas nice video and I have same question. This is really interesting that we can convert Web API it self into Lambda instead of having different hosting model that Azure function is using for in process and out of process.
@verdurakh2 жыл бұрын
So cool, is it possible to combine this with event bridge to deploy existing apis and run them as a scheduled job?
@TroyCSchmidt2 жыл бұрын
Yes to testing and infrastructure as code!!
@aarzoomanoosi2 жыл бұрын
Please list down all AWS policies that we needed to allow the access to deploy this lambda function
@petrowi2 жыл бұрын
My company has invested heavily in Azure, can you demonstrate a serverless app with Azure Functions?
@nickchapsas2 жыл бұрын
I haven't used Azure Functions extensively so no
@waltavista2 жыл бұрын
Apart from the fact that this video is great: For Azure Functions open Visual Studio, new Azure Function project, HTTP trigger...., right click "Publish"...
@alphaios77632 жыл бұрын
Hey, Nick. Could you please share your oh my posh theme? Maybe a repo that you could link in the description?
@caunt.official2 жыл бұрын
Can you make tutorial on Orleans with AWS or Azure database?
@stanimirkolev5842 жыл бұрын
We need more Azure tutorials
@PaulSebastianM2 жыл бұрын
What did you use to draw that square on top of the terminal (draw on screen)?
@Ultimatepritam2 жыл бұрын
OhMyPosh theme
@grupomexcomer Жыл бұрын
What about the cold start? Is that really a blocker from going to production for a big application? Or better choice go using NodeJS?
@m1dway Жыл бұрын
how do you get the aws-lambda-tools-defaults.json created for an existing project? I don't have it with me
@antonmartyniuk2 жыл бұрын
an AWS dedicated course will be a great thing indeed. any plans for it?
@alvaromontoya37642 жыл бұрын
Yes testing lambdas please
@vivekgowda15767 ай бұрын
Is this a good approach to use If we build large applications using a clean architect? or can we create a lambda function for each controller level to reduce the burden on lambda?
@michaelakin7662 жыл бұрын
Hi Nick, any way you could connect this to ApiGateway and show how to inject the APIGatewayProxyRequest and get the stage variables?
@michaelakin7662 жыл бұрын
And also show Cognito Authorization and how to get the current logged in user in the minimal api.
@JohnWatersKlas Жыл бұрын
Hey Nick - this doesn't seem to work for dontnet 7 - which I am using for min API, and need features like Groups ... what to do?
@clearlyunwell2 жыл бұрын
This is great, Nick. So many random numbers, the calculation addition, and your date of birth LOL. More of these videos please.
@SupraStututututu5 ай бұрын
How did you connect to AWS? I see you just created a new project and it published AWS lambda directly to your AWS account without connection being specified
@Arapa0072 жыл бұрын
Great video as always! Any tip on how to reduce the cold start issue?
@nickchapsas2 жыл бұрын
In reality, other than optimizing your startup, there isn't much you can do. Source generators do help with that and .NET is just naturally becoming faster as it goes so it will get better. That being said, if you expect the API to be busy, you don't really have to worry about it. I've seen people use "Warmers" which is basically just a periodic "ping" to the lambda to keep it warm but I don't know how I feel about that.
@EmptyGlass992 жыл бұрын
In AWS you can configure Lambdas to be always provisioned i.e. always ready and waiting to go - no cold starts. However, it costs more.
@PatrickMageez2 жыл бұрын
What's cheaper? Aws lambda for an api or a docker container in aws
@nickchapsas2 жыл бұрын
@@PatrickMageez Depends on request duration and memory consumption but in general lambdas are cheaper
@Stealthy5am2 жыл бұрын
@@EmptyGlass99 you'll still get cold starts if you get n+1 concurrent requests where n is the number of instances you provision. So you don't solve the problem you just push it further away.
@JohnWatersKlas2 жыл бұрын
Is there a corresponding simple way to serve up an ApiController or MinApi project as a azure function? The one liner you had for lambda?
@kshitijurankar52542 жыл бұрын
Hi Nick, Not related to posted video but can you make video on patteran and/or library to deal with processing huge files? How multi threading approach we should use?
@tarrencedavis78132 жыл бұрын
Is there anyway to rate-limit function URL endpoints for a Lambda function? Related question: is there anyway to protect the function URL against DOS attacks?
@PelFox2 жыл бұрын
Put them behind eg. Apim.
@wh33lers2 жыл бұрын
Could you also host a razor based page instead of an Api, or would this break the concept. Thanks for the content as always
@czajla Жыл бұрын
Why it always goes this way? dotnet new -i Amazon.Lambda.Templates return error: Can't install packet ... because packet does not exits. Am I missing any prerequisites?
2 жыл бұрын
Always nice video! I know that lambda have a limit storage and limit time of process, so if our api have to process big data on long time, our api will broken for this lambda restrictions ?
@nickchapsas2 жыл бұрын
You shouldn’t be using lambdas for things that take a long time to process. You pay by duration and memory so it is recommended that you use an actual service instead for things that need to process something for longer than a few seconds
@jamescanady81562 жыл бұрын
@nick I have a few questions. Is there a way to include ILambdaContext in the method parameters
@TheHydrogen42 жыл бұрын
What is that at 6:43? var rsp = new { query, message ="" }; When was that implemented? what is it called? is it a class, a struct? Is it type object? Never seen that json like syntax in cs before
@nickchapsas2 жыл бұрын
It’s an anonymous object. It’s been there for many years
@TheHydrogen42 жыл бұрын
@@nickchapsas What version? I cant get the compiler to recognize the syntax. I am currently using .Net core 3.1
@garyc940210 ай бұрын
What is the IDE that you're using in the video?
@lothar1002 жыл бұрын
How do you write the JSON parameters in a cloud formation YAML? I must not be doing it right. I want to deploy with SAM in a stack, not just a standalone Lambda Function.
@MrOboema2 жыл бұрын
Maybe its in the video, and I glanced over it, but...in case of the "regular" API, the downside is cold-start of the API itself, as discussed in the video. Does in here know why this is cold-start in necessary? I understand not every API app registered in AWS, can be loaded in memory at all times and ready to go in case a client needs it, but I dont see why this is in case of a "regular" REST API, and not in case of the API specifically written for AWS Lambda.
@sunnypatel10452 жыл бұрын
Hi Nick why do you use FastEndpoint rather then your structured reflection? Have you done some benchmarking by any chance?
@nickchapsas2 жыл бұрын
Overall I prefer FastEndpoints just because of the features you get out of the box. It's basically what my structured reflection would look like if I finished
@sunnypatel10452 жыл бұрын
@@nickchapsas I will need to look into it. I currently got an implementation of your reflection structure with mediatR. But will compare both 😬. Thanks dude and good to see you at NDC!
@dpak21122 жыл бұрын
Hi Nick, please make a video on cloud formation
@LilPozzer Жыл бұрын
Hi! I'm trying to upload a published x64 zip app to lambda, but it doesn't work and says me in the logs "Unhandled exception. System.BadImageFormatException: An attempt was made to load a program with an incorrect format.", I tried every runtime, changed even in the lambda settings, NOTHING. im crying
@leesteve68422 жыл бұрын
it is so great👍
@christophem63732 жыл бұрын
A video about Application Insight ?
@nickchapsas2 жыл бұрын
I don't use Application Insights so no
@michaelakin7662 жыл бұрын
Did I miss where you created the aws config?
@nickchapsas2 жыл бұрын
My workstation is authenticated so I don't need to authenticate against the service in the same way that the app would be authenticated so there is no need for credentials
@michaelakin7662 жыл бұрын
@@nickchapsas I was talking about the aws-lambda-tools-defaults.json file.
@michaelakin7662 жыл бұрын
Oh, I just saw where you said you added it. How did you find the structure of the file to add?
@Koolakoola-ve7sq Жыл бұрын
why did you use functions url and not api gateway?
@anre13182 жыл бұрын
Hey Nick! Whats about startup time if I have a huge startup function including DB Context etc.. Does this affect my response time? Probably or?
@nickchapsas2 жыл бұрын
It will affect the first execution but not future ones, unless the lambda goes cold (uncalled for 30-45 minutes)
@anre13182 жыл бұрын
@@nickchapsas Hey Nick! Thanks for response. I am trying the third(?) approach, just adding services.AddAWSLambdaHosting(LambdaEventSource.RestApi); on Startup. Deploying via Terraform and then create Function URL is working fine and I can just call my endpoints. Do you know, what I need to do to integrate it with ApiGatway? Just proxying everything but I receive error: Object reference not set to an instance of an object. at Amazon.Lambda.AspNetCoreServer.APIGatewayHttpApiV2ProxyFunction.MarshallRequest(InvokeFeatures features, APIGatewayHttpApiV2ProxyRequest apiGatewayRequest, ILambdaContext lambdaContext)
@DerekWelton2 жыл бұрын
Off topic question Nick, what software are you using to markup your screen and zoom?
@nickchapsas2 жыл бұрын
It’s called ZoomIt
@mattiaricci9102 жыл бұрын
is it possible to deploy an entire dotnet solution usgin this method? i have an api with 5 projects (one of which is the controller based api), what configuration would i need to deploy the solution on aws lambda?
@nickchapsas2 жыл бұрын
Sure you can, but I would recommend invidious deployment pipelines and separate lambdas per api
@mattiaricci9102 жыл бұрын
@@nickchapsas thank you nick! if i were to do it (for testing purposes) i would just need to add lambda hosting and set the function-handler as the name of the project that has the controller in it, is that right?
@mattiaricci9102 жыл бұрын
just an update, i managed to get i to work, i only needed to allow the lambda to access my rds instance, now it's working as intended
@jadejahardisinh2 жыл бұрын
@Nick Chapsas - How can we achieve same goal with API gateway? Because API Gateway provides custom domain facility.
@HenriqueGraca2 жыл бұрын
Hey Nick, great content as always. I think there is an error on you example (at least that is the only way that worked for me), When you configure the function-handler, it should be . (period) instead of : (colon) between SimpleApi and Functions, the working string "SimpleApi::SimpleApi.Functions::Get" EDIT: I see you fixed it during the video :)
@joshstather35432 жыл бұрын
10:24 . Nice
@陳宏易-w6m2 жыл бұрын
What if I create a bunch of functions for each endpoint instead of one lambda for all routes? This basically what serverless framework do but I wonder the difference in performance.
@BrendonParker2 жыл бұрын
Actually, it performs better to have them all in one lambda. You don't pay the cold start cost for each lambda endpoint.
@marcotroster82472 жыл бұрын
Hey guys, can you explain to me why I would want serverless? (serious question, I'm open to argue) What enthusiasts are telling me is "it's cheap and you don't need an ops team anymore". But I strongly doubt that. "Infinite scaling" seems to be a reasonable goal, but it comes at the cost of decomposing the system to an extent where noone can even understand what's going on. So, is it really as desirable as people are telling me all the time? 😅
@nickchapsas2 жыл бұрын
It is. When it makes sense for a usecase it is a no brainier. It’s cheaper, you have less things to manage, deployment is easier, scaling is easier, monitoring is easier and you get tons of native integrations with other services within your cloud provider of choice. You can focus on building a product over everything around it
@marcotroster82472 жыл бұрын
@@nickchapsas Thank you. Sounds reasonable for smaller projects or startups 😄 You know, I've heard of companies who are running 10-100k of lambda endpoints in their deployment and literally lost control over which lambda they actually need and which they can turn off. Isn't this a big concern when the codebase is growing out of control? 🤔
@nickchapsas2 жыл бұрын
@@marcotroster8247 Actually it's great for big companies as well. We use them extensively to build our products and we prefer them over traditional microservice. We use Backstage to keep track of everything and we have really good APM. Don't dismiss them. In most cases they are a better and more manageable approach than microservices
@stefanstojanovic75962 жыл бұрын
What kind of terminal is that with colors and git branch info?
@nickchapsas2 жыл бұрын
It's Powershell Core through the WIndows Terminal with oh-my-posh installed
@stefanstojanovic75962 жыл бұрын
@@nickchapsas thank you!
@osman34042 жыл бұрын
Is the same thing possible for azure functions? If not it’s very ironic since both azure serverless functions and minimal api are both from Microsoft lol
@nickchapsas2 жыл бұрын
The "turning an asp.net core api to an azure function with just one line of code" part, isn't AFAIK
@sunilanthony172 жыл бұрын
We use Azure only, can you create a video to create serverless REST API in Azure?
@PhillipHolmes-j5n11 ай бұрын
what editor is that?
@pavl0britt2072 жыл бұрын
Could you help me please, I don't have New Project templates after installation of amazon tools
@pavl0britt2072 жыл бұрын
Fix! dotnet new --install Amazon.Lambda.Templates::6.1.1 help me
@narebinhaa Жыл бұрын
After running "dotnet lambda deploy-function on Windows 11, I am running into this error. Does anyone knows how to sove it? "publish: C:\Program Files (x86)\dotnet\sdk\7.0.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.CrossGen.targets(470,5): error : Error: Unable to load DLL 'clrjit_unix_x64_x86' or one of its dependencies: The specified module could not be found. (0x8007007E)"
@Randomize-md3bt8 ай бұрын
THANK U,
@slicerdw12 жыл бұрын
How does API GW plays a role in these scenarios?
@nickchapsas2 жыл бұрын
With Function URLs it doesn't need to
@anatoliypronyk18332 жыл бұрын
go IaC! it would be great
@PaulSebastianM2 жыл бұрын
69... Nick! This is a programmer friendly community! 😂😂😂😂
@clashclan47392 жыл бұрын
you should have used Azure 😥😥
@王鑫海-d4c2 жыл бұрын
IMO aws lambda is way better and intuitive than azure functions for c# development. What a shame!
@bigbull31122 жыл бұрын
How did you publish to Lambda without using any key, connection to AWS? not clear. too fast. not for teaching but just for show off
@adelarsq Жыл бұрын
Legal
@clearlyunwell2 жыл бұрын
👍🏽
@jeffreychong79282 жыл бұрын
Oh man, I am not the first one leVe comment
@DaminGamerMC2 жыл бұрын
I have been programming for many many years in many different languages but I really do not understand any of this. I do know what a Rest API but that is it... I know this Cloud Programming stuff is becoming a very important thing but I dont even know where to start to learn and undertsand all of this.
@sunnypatel10452 жыл бұрын
The only way to learn is by doing mate. Read documents and go through step by step tutorials AWS and Azure done a fantastic job on docs.
@Bleppacus2 жыл бұрын
"Building a Serverless..". "What i just want to do is to deploy that straight away". Serverless does not exist. It is still hosted somewhere..
@nickchapsas2 жыл бұрын
Serverless doesn’t mean there is no server. It means that to you building and deploying the API, there is no server.
@Ristogod2 жыл бұрын
I don't see AWS as viable given that they've demonstrated their willingness to just disable your stuff if you don't agree with "the message"
@StarsTogether Жыл бұрын
Good stuff! Want more on this? I recommend a book that aligns with this content. "AWS Unleashed: Mastering Amazon Web Services for Software Engineers" by Harrison Quill
@alexliroyd36842 жыл бұрын
69 - nice
@quranthecompanion45282 жыл бұрын
you are using more AWS lately. SOFT promotion, lol
@nickchapsas2 жыл бұрын
I’ve been exclusively using AWS for the past 3 years. I don’t use Azure