No video

Building .NET 8 Minimal APIs With AWS Lambda and Amazon RDS

  Рет қаралды 34,074

Milan Jovanović

Milan Jovanović

Күн бұрын

Get the source code for this video for FREE → the-dotnet-wee...
Join a community of 1000+ .NET developers: / milanjovanovic
Master the Clean Architecture: bit.ly/3PupkOJ
The ultimate Modular Monolith blueprint: bit.ly/3SXlzSt
AWS Lambda is a compute service you can use to deploy your applications to the cloud. It has support for .NET 8. Want to know the most awesome part? You can deploy your .NET Minimal API applications with just one line of code. In this video, I'll show you how to create an AWS Lambda, deploy your .NET application, and connect it with Amazon RDS.
Get $25 AWS credit for free here: aws.amazon.com...
Grab the source code from GitHub: github.com/m-j...
Check out my courses:
www.milanjovan...
Read my Blog here:
www.milanjovan...
Join my weekly .NET newsletter:
www.milanjovan...
Chapters
0:00 AWS Lambda introduction
3:02 URL Shortener demo
5:02 PostgreSQL with Amazon RDS
9:16 Deploying .NET 8 AWS Lambda
11:53 AWS Lambda configuration & demo

Пікірлер: 42
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Get the source code for this video for FREE → the-dotnet-weekly.ck.page/aws-lambda Want to master Clean Architecture? Go here: bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt
@vlad.kravchenko
@vlad.kravchenko Ай бұрын
I'm a complete 0 in AWS. Before, I tried few times publishing Hello World on AWS using other tutorials and Chat GPT with no luck. Thanks to you now I have one up and running!
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Nice work! I'm so thrilled to hear that, honestly 😅
@rookieew
@rookieew Ай бұрын
Dont do this! Only with AOT. The C# Lambda cold starts are horrible. And if you use the aws lambds templates and every api method in a function handler you'll pay the pain. Dont forget the most aws Services are money maker. Read the Lambda docus twice.lambda Powertools double your cloudwatch Costs. Beware the using of cloud if you dont really know how it works and what you will pay.
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
| Dont forget the most aws Services are money maker. Is this not true for any cloud service? Is this also not true for the applications we build (hopefully)? Price is also an argument of value - do you get enough value back for the price you pay. Value is a function of what's important to you(r team).
@pilotboba
@pilotboba Ай бұрын
There are some things you can do. Also cold start time depends on how many lambdas in the AWS region/az are using the runtime. Also, if you are getting a decent amount of traffic, the underlying infra isn't shutting down, so you don't get as many "starts" . Everything is a tradeoff. Cost of ECS with fargate could be less, it could be more. It depends. There is a tipping point were traffic gets more expensive and it's time to move from lambda -> containers on fargate -> containers on EC2 -> MVs on EC2 with wix or something. Maybe in the future wasi with native AOT will actually happen.
@user-hy7kx1gu5x
@user-hy7kx1gu5x Ай бұрын
Thanks for this Milan - how would you adapt this for larger APIs? I.e how can you create multiple lambdas for each endpoint? Do you do a separate project, or is there a way to deploy a lambda per endpoint?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Will discuss this in a future post/video, great question
@blackpaw29
@blackpaw29 Ай бұрын
Interesting, quite straightforward. Pity theirs not a permeant free RDS tier.
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
I'd say you can still host a database cheaply. Of course, we'd have to compare it to other options (or cloud providers) to decide which option is better.
Ай бұрын
Dude nice video! thanks for sharing all your knowledge with all of us. Quick question, why do you prefer Postgres instead of MSSQL for mostly all your videos? Is it because of the open-source stuff?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
I prefer PostgreSQL for the more flexible data model and rich JSON support. Plus you can store arrays and event key-value pairs. Opens up very interesting data modeling options. That that it's free to use, unlike MSSQL which requires a license, is another reason. However, I've worked with MSSQL for years, maybe even more than I've used PostgreSQL.
@vshengur
@vshengur Ай бұрын
Thanks for good idea for Friday's evening!)
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
You are welcome! I love how simple they've made the entire process.
@igorilyichyov6414
@igorilyichyov6414 Ай бұрын
Milan, thanks a lot for this video! It's very useful!
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Glad it was helpful!
@ransandu
@ransandu Ай бұрын
Thanks for sharing this. Seems AWS made .NET developers life easier. On the same note, would you be able to explain the difference betwen LambdaEventSource.HttpApi and LambdaEventSource.RestApi? Cheers
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
We're choosing between the type of API Gateway that will send requests to the lambda: docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html - RestApi = API Gateway REST API - HttpApi = API Gateway HTTP API
@pilotboba
@pilotboba Ай бұрын
I know it's a demo... but most of the work to configure stuff in AWS should be done with cloud formation, the aws cloud dev kit or terraform. Also, I would expect DynamoDb would be much less expensive for this application than Postgress. It's basically just key/value. Also, some caching will help keep costs down, perhaps with cloudfare. You can do a lot with the cloudflare free level. Since once you have a sort URL it's not going to change and can be cached almost forever.
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
| but most of the work to configure stuff in AWS should be done with cloud formation, the aws cloud dev kit or terraform. That's assuming you have AWS experience, know how to setup the infrastructure, etc. In most companies that will be done by a dedicated DevOps role. So it's though to expect from people new to AWS to know how to set all that up from scratch. But I see the video is giving you some nice ideas. URL shorteners are fun for system design exercises, as you can touch on important concepts.
@abhinavsrivastava2128
@abhinavsrivastava2128 Ай бұрын
Hey Milan, huge fan of your videos. However, for this particular video, don't you think you should reconsider the choice of tool for hosting web applications from aws suite? Not only does the lambda cold start cause issues of increased start up time but also from the perspective of the web application having background services, the max run time limitations of lambda functions don't help much. Moreover looking at the benefits of lambda that you highlighted almost all of them are available with something like fargate beneath ECS. Please let me know your thoughts on this thanks.
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
| from the perspective of the web application having background services We won't use Lambda in this case, obviously. Or we could run background services in a separate process. | the lambda cold start cause issues of increased start up time How much of an issue is it? I think this should be something we measure and see
@AurelioPiccinino
@AurelioPiccinino Ай бұрын
Nice video, is it possible create Minimal APIs also with Azure function ?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Most likely, let's do another video
@xearlx
@xearlx Ай бұрын
Great demo! I'm using api gateway + .net aws lambda for a rest api, but sometimes warmup time is over 5seconds in prod. Do you experience this or have any suggestions countering aside from writibg a lambda warmer which I've already done lol??
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
This also sets up an API gateway that routes the request to the lambda. For faster startup, you can try AOT compilation. But other than that...
@user-xm7sh3vw8o
@user-xm7sh3vw8o Ай бұрын
How do you use the domain model modification, for example, in the order field, I need to change the data, but the content is not sure, how to make the modification method of the domain model
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Which order field?
@user-xm7sh3vw8o
@user-xm7sh3vw8o Ай бұрын
@@MilanJovanovicTech Any one
@user-hj6bb9my1f
@user-hj6bb9my1f Ай бұрын
Milan, can you do a video about Read and Write separation at a database level.Curious to see how you would handle this.
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
I believe I did
@AndrewJudd
@AndrewJudd Ай бұрын
Doesn't making your RDS instance public pose security issues since the outside world is then able to connect to it?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Yes, just for demo purposes though.
@AndrewJudd
@AndrewJudd Ай бұрын
@@MilanJovanovicTech The problem is that's not mentioned in the video, and when you end up deploying to the Lambda function, there is a little more set up required for making it work with the database when it's not available remotely. That part of it is rarely mentioned in any demo videos but is a key part of the actual set up.
@comroec
@comroec Ай бұрын
How to generate the report with Blazor? pls (crystal or any)
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
What report?
@comroec
@comroec Ай бұрын
@@MilanJovanovicTech SAP Crystal Reports
@pilotboba
@pilotboba Ай бұрын
Not sure what this video has to do with generating reports. If you want to consult with Milan I bet he would be happy to give you a quote. :)
@comroec
@comroec Ай бұрын
​@@pilotboba I need a sample Blazer project with a report generate. pls
@antonmartyniuk
@antonmartyniuk Ай бұрын
Nice video!
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Thanks!
@ahmadshoib8957
@ahmadshoib8957 Ай бұрын
​@@MilanJovanovicTech1:29 1:32 1:32
Easily Deploy a .NET Application to AWS Elastic Beanstalk
16:32
Milan Jovanović
Рет қаралды 28 М.
Forget Controllers and Minimal APIs in .NET!
14:07
Nick Chapsas
Рет қаралды 64 М.
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 21 МЛН
EVOLUTION OF ICE CREAM 😱 #shorts
00:11
Savage Vlogs
Рет қаралды 14 МЛН
Они так быстро убрались!
01:00
Аришнев
Рет қаралды 2,9 МЛН
Vertical Slice Architecture Project Setup From Scratch
22:43
Milan Jovanović
Рет қаралды 55 М.
Exploring Caddy, An Open Source Web Server
16:01
Dan on Open Source Software
Рет қаралды 981
Stack Overflow stopped caring about developers a long time ago
22:33
Coding with Dee
Рет қаралды 56 М.
Walking Away From JavaScript
1:06:44
ThePrimeTime
Рет қаралды 153 М.
The Logging Everyone Should Be Using in .NET
15:34
Nick Chapsas
Рет қаралды 57 М.
Should I Create A Minimal API Or Full API?
7:40
IAmTimCorey
Рет қаралды 35 М.
7 Years of Software Engineering Advice in 18 Minutes
18:32
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 21 МЛН