No video

How to Deploy FastAPI on AWS EC2: Quick and Easy Steps!

  Рет қаралды 53,213

pixegami

pixegami

Күн бұрын

In this video, I'll show you how to deploy a Python FastAPI application to an AWS EC2 instance, so that your API becomes publicly accessible on the internet.
👉 Previous FastAPI Tutorial: • FastAPI Python Tutoria...
👉 Code: github.com/pix...
👉 SSH to EC2 from Windows: stackoverflow....
👉 AWS: aws.amazon.com/
👉 FastAPI: fastapi.tiango...
👉 FastAPI on AWS Lambda: • Deploy FastAPI on AWS ...
00:00 Introduction
00:30 Launch an EC2 instance
04:06 Connect to your EC2 instance
05:35 Install pip and NGINX
06:20 Route API traffic with NGINX
09:06 Run the FastAPI server
11:39 Testing the API
13:01 Terminate the EC2 instance
#fastapi #aws #pixegami
🎨 Background vector created by GarryKillian
www.freepik.co...

Пікірлер: 142
@pixegami
@pixegami 2 жыл бұрын
💡If you want an even BETTER way to host your FastAPI, check out my video on how to use FastAPI with AWS Lambda: kzfaq.info/get/bejne/iK15gJd7y9m3m2Q.html This is serverless and in most cases is superior to EC2 in terms of scaling and cost.
@xplorewithpathy1407
@xplorewithpathy1407 9 ай бұрын
for anyone wondering how to save and quit you'll first need to return to command mode. You can tell you're in insert mode if you see -INSERT- at the bottom of the editor. To exit insert mode and go back to command mode, press the Esc (Escape) key on your keyboard. Once you are in command mode, you can save and quit by typing :wq. This command is a combination of :w (which saves the file) and :q (which quits the editor). Press Enter after typing :wq to execute the command.
@faizanahmad3452
@faizanahmad3452 9 ай бұрын
i just spend 1 hour on this :(😑
@oscarvgx
@oscarvgx 4 ай бұрын
god bless you
@jaykay999
@jaykay999 Жыл бұрын
by the way guys, if you connect directly using aws interface, and you struggle to save the vim file where he adds the proxy pass and stuff. here is chatgpt answer to do operations for the vim file : vim has a steeper learning curve but is very powerful: Start in 'normal' mode (where you can navigate and use commands, but not type text). To enter 'insert' mode (where you can type text): Press i To save: First return to 'normal' mode by pressing ESC, then type :w and press Enter To exit without saving: Press ESC then type :q! and press Enter To save and exit: Press ESC then type :wq and press Enter Copy (called 'yanking' in vim): In normal mode, move to the line you want to copy and press yy Paste (called 'putting' in vim): Move to where you want to paste and press p Delete a line: In normal mode, press dd
@favs5286
@favs5286 Жыл бұрын
great content, i learned so much in under 15 minutes
@jithinjagadeesh4471
@jithinjagadeesh4471 4 ай бұрын
Thank you so much for this video. Helped me a lot in configuring nginx and deploying on EC2!
@pixegami
@pixegami 4 ай бұрын
Glad it was useful! I recommend checking out how to deploy FastAPI to AWS Lambda as well (it's cheaper and easier to maintain).
@user-lm4gs6fc3p
@user-lm4gs6fc3p 2 жыл бұрын
Thanks a lot! This is the only of thousands that realy helped me to launch my project!!!
@pixegami
@pixegami 2 жыл бұрын
You're welcome!
@TheEricon
@TheEricon Жыл бұрын
would be nice to see you implement the https version of this, amazing video!
@pixegami
@pixegami Жыл бұрын
Thanks for the suggestion!
@alberjumper
@alberjumper Жыл бұрын
@@pixegami Is it done now??
@jspjsp30431
@jspjsp30431 2 ай бұрын
thank's your kind video from south korea!
@justin23262
@justin23262 2 ай бұрын
hi, can i ask? if I shutdown my computer, can people access my api ?
@kevon217
@kevon217 8 ай бұрын
exactly what i was looking for. thanks!
@pixegami
@pixegami 7 ай бұрын
Awesome! I'm glad to hear that :)
@randomforest_dev
@randomforest_dev 8 ай бұрын
I used to create a new domain config under 'sites-available' first and then link to 'sites-enabled' ? what is the right way?
@HarshPanwar9524
@HarshPanwar9524 Ай бұрын
Amazing tutorial. Thankyou!
@berkefekeskin9172
@berkefekeskin9172 Жыл бұрын
Thanks for such a understandable tutorial.
@pixegami
@pixegami Жыл бұрын
My pleasure. I hope it helped!
@mariaponomarenko3006
@mariaponomarenko3006 Жыл бұрын
You have such a nice voice 😍 THANK YOU FOR THE VIDEO
@pixegami
@pixegami Жыл бұрын
Thank you, glad you enjoyed it! 🫶
@shawn.builds
@shawn.builds 8 ай бұрын
this worked for me. thank you very much sir!
@pixegami
@pixegami 8 ай бұрын
Glad it helped
@alexandere9723
@alexandere9723 2 жыл бұрын
Great Video, thank you very much. Works like a charm
@pixegami
@pixegami Жыл бұрын
Great to hear!
@abbasali6588
@abbasali6588 Жыл бұрын
Great video!!! You even cleared a lot of fundamentals for me! I believe the same concepts will work for any ubuntu vps right ? Other than an ec2 instance ? thanks!
@pixegami
@pixegami Жыл бұрын
Yup, I think most of the concepts will still apply to any kind of Linux VPS :)
@SantiagoZuluaga
@SantiagoZuluaga Жыл бұрын
Great Video, using vim like a Crack!
@pixegami
@pixegami Жыл бұрын
Thanks!
@mapneto
@mapneto Жыл бұрын
thank you very very much! Greate Tutorial and explanation.
@pixegami
@pixegami Жыл бұрын
Glad it was helpful!
@mil0rd78
@mil0rd78 6 ай бұрын
Excelente tutorial, gracias por compartir tu conocimiento
@pixegami
@pixegami 6 ай бұрын
You're welcome!
@dariusboteand7722
@dariusboteand7722 3 ай бұрын
I'm using vultr, installed nginx and configured as shown. It just doesn't work for me, no matter how I edit this, the url just says that page isn't working... any idea?
@mikecmw8492
@mikecmw8492 Жыл бұрын
It would be nice to see how to automate this. In this case you are manually typing a command. What would you use to automate a deployment to the EC2?
@pixegami
@pixegami Жыл бұрын
Good point. You'd have to set up a CICD workflow. I recommend GitHub actions. Here's a new video I just made on it: kzfaq.info/get/bejne/b9t9lrFnm9PKp3k.html The video doesn't look at EC2 specifically (I prefer Lambda for compute), but the concept's pretty much the same.
@smitimaheshwari5595
@smitimaheshwari5595 Жыл бұрын
Thanks a lot! This was really helpful. :)
@pixegami
@pixegami Жыл бұрын
You're welcome!
@yannickpokam3864
@yannickpokam3864 Жыл бұрын
Thanks Bro !!! this video help me a lot,
@arturoguillen90
@arturoguillen90 2 жыл бұрын
Thanks brother, amazing job ...
@avighnajha7114
@avighnajha7114 2 жыл бұрын
Hey, great tutorial. Im currently working on my first API for an android app and was wondering how the api connects to a database once deployed to cloud? Does the database also need to be uploaded? Im sorry if the question sounds dumb but im still learning.
@pixegami
@pixegami Жыл бұрын
Great question - That's the next step! If you host your FastAPI on EC2, you can just put the database on EC2 as well. But here I just released a video on how to host a serverless FastAPI (and use a serverless database with it): kzfaq.info/get/bejne/n7KkY5OT1taamac.html
@isaquehg
@isaquehg Жыл бұрын
If you're using a NoSQL database like MongoDB it's easier, bacause it's already deployed, so you only need to use the connection URL string in the API and give the needed permissions
@aashishmanandhar5188
@aashishmanandhar5188 Жыл бұрын
@@isaquehg bad suggestion imo, choice of db completely depends on the use case of the project. NoSQL might or might not fit into the usecase.
@FarhanAhmed1360
@FarhanAhmed1360 Жыл бұрын
when I close my aws terminal then my fastapi app gone anyway. how to keep running my fast api app even I close my terminal ?
@pixegami
@pixegami Жыл бұрын
That's because the Fast API process also terminates when you disconnect from the shell. You have to run it in the background. NGINX should have a way to do that for you - but if it doesn't, then you can try other ways to run it in the background (or as a Daemon). I don't have a video on it yet, but maybe something like this from the command: stackoverflow.com/questions/44222883/run-a-shell-script-and-immediately-background-it-however-keep-the-ability-to-in Or there are some more options here: stackoverflow.com/questions/1603109/how-to-make-a-python-script-run-like-a-service-or-daemon-in-linux
@user-hj8vb7xv6e
@user-hj8vb7xv6e 5 ай бұрын
Please let me know how to solve 404 error. Nginx not found and Bad gateway error. Im getting 404 error if i try to run the instance after couple of days of deployment.
@amarnathreddysurapureddy9111
@amarnathreddysurapureddy9111 6 ай бұрын
Hi Sir, 1) I followed your tutorial and i run the smallest Application with ec2 and fast Api. 2) I created big application in that static, templates and model folders is there . How can i include in configuration of nginx.
@pixegami
@pixegami 6 ай бұрын
Nice work! I don't actually use NGINX a lot myself, so I think you'll have to look on your own how to integrate that with your FastAPI server. For FastAPI my preferred way to deploy it is actually to use Lambda functions like in this video: kzfaq.info/get/bejne/iK15gJd7y9m3m2Q.html
@amarnathreddysurapureddy9111
@amarnathreddysurapureddy9111 5 ай бұрын
I got it no need to mention anything. folder structure is important.@@pixegami
@woodyjo
@woodyjo Ай бұрын
thank you for your help but I have a question in my case when I try to do "sudo service nginx restart" or "sudo service nginx start" Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details. it shows me this error how can I figure it out?
@MrKB_SSJ2
@MrKB_SSJ2 16 күн бұрын
syntax error in nginx
@angelmata9607
@angelmata9607 2 жыл бұрын
Thanks you very much it was very useful
@pixegami
@pixegami 2 жыл бұрын
Glad to hear that!
@divyagarh
@divyagarh 5 ай бұрын
Thanks for the video. Could you also make an video about nginx, gunicorn, supervisor and having a frontend like vue?
@pixegami
@pixegami 4 ай бұрын
Thanks for the recommendation. I haven't actually used that stack much so I doubt I'll be able to make a good video on it, but I'll add it to my list of things to learn.
@raidwair
@raidwair 11 ай бұрын
No creo que hables español, pero te amo.
@pixegami
@pixegami 11 ай бұрын
Thank you :)
@KTMedia-hx5gg
@KTMedia-hx5gg 11 ай бұрын
I am having problem in nginx part, when I try to close vim there, it doesn't close directly, It says either write a command or press enter, and takes me back to the same interface where I can edit the file
@joseramon1017
@joseramon1017 2 жыл бұрын
whoa! This is awesome 🌟 🌟 🌟 🌟 🌟
@pixegami
@pixegami 2 жыл бұрын
Thank you! Cheers!
@satwikawasthi2002
@satwikawasthi2002 Жыл бұрын
I couldn't understand if we launched our instance then AWS charged us and if not then after how much time it start charging?
@pixegami
@pixegami Жыл бұрын
As of 2023 (when I'm typing this) EC2 has a 1-year free tier for the micro instance type: aws.amazon.com/free/ But if you use serverless hosting (Lambda) you can get something like 1 million free requests per month, which is much better in my opinion: kzfaq.info/get/bejne/iK15gJd7y9m3m2Q.html
@jameskilibaha9398
@jameskilibaha9398 4 күн бұрын
thanks man be bless
@justmiroslav
@justmiroslav 9 ай бұрын
How did you put the cursor on --INSERT-- in the nginx file to write :wq and close it?
@xplorewithpathy1407
@xplorewithpathy1407 9 ай бұрын
you'll first need to return to command mode. You can tell you're in insert mode if you see -INSERT- at the bottom of the editor. To exit insert mode and go back to command mode, press the Esc (Escape) key on your keyboard. Once you are in command mode, you can save and quit by typing :wq. This command is a combination of :w (which saves the file) and :q (which quits the editor). Press Enter after typing :wq to execute the command.
@hectorherreraespinola6399
@hectorherreraespinola6399 Жыл бұрын
HI! very good video. I have a questions. After stopped the virtual machine and restart it, the FastAPI app does not work. Should I change any information each time I turn off the created EC2?
@yloibx
@yloibx 2 жыл бұрын
thanks. very useful.
@suman6327
@suman6327 11 ай бұрын
Thanks for this tutorial. Am new to AWS / EC2. Would like to know why would one need NGINX here ? Can't we spin up Fast API container & then access it using EC2 Public IP ??
@pixegami
@pixegami 11 ай бұрын
You probably can, but using NGINX as a reverse proxy is a very typical design pattern for this type of app just because of the control and security it provides. But if you have a lightweight use case and don't need all the extra stuff that NGINX helps with, yes I think you can just use FastAPI on a fixed port.
@suman6327
@suman6327 11 ай бұрын
@@pixegami I tried with & without NGINX - both work fine. Thanks 👍
@edwardwong654
@edwardwong654 10 ай бұрын
Nice example. Wouldn't it be easier to just use docker, and deploy it on container with k8's?
@pixegami
@pixegami 8 ай бұрын
It might be, if you have experience with Docker and K8s already. Personally I think something like Lambda is better for APIs like this (I have a tutorial on that too). But I think having a basic EC2 example as a tutorial is the easiest to grasp (even if it's not the best way to build this long term).
@edwardwong654
@edwardwong654 8 ай бұрын
@@pixegami Damn. I appreciate you replying. I am not worthy. :-) But thank you!
@andriyOshtuk
@andriyOshtuk 4 күн бұрын
If you stop instance and start it again you are going to lose all your set up. How to make these usung "user data"?
@user-eg9dc8kz2d
@user-eg9dc8kz2d 6 ай бұрын
thank you!
@pixegami
@pixegami 6 ай бұрын
You're welcome!
@timo_b3
@timo_b3 Жыл бұрын
Thank you!
@pixegami
@pixegami Жыл бұрын
You're welcome!
@lamarkneris3367
@lamarkneris3367 Жыл бұрын
Thanks a lot!
@pixegami
@pixegami Жыл бұрын
No worries!
@yura2110
@yura2110 2 жыл бұрын
hey, how can you make the fast api /docs not visible from the users ?
@pixegami
@pixegami 2 жыл бұрын
You should be able to turn it off like this: `FastAPI(docs_url=None)`. See this for more info: fastapi.tiangolo.com/tutorial/metadata/#docs-urls
@yura2110
@yura2110 2 жыл бұрын
@@pixegami thank you !! have a great day
@chetanpatel2282
@chetanpatel2282 Жыл бұрын
@pixegami What about production environment? You explained how to run it. How can you keep it running if you are hosting on ec2 for production use?
@pixegami
@pixegami Жыл бұрын
For production, if you are building a new app, I recommend going serverless. It's much easier to maintain and keep running (you don't need to worry about scaling, patching, load balancing, security). Check out a similar video for how to deploy FastAPI on AWS Lambda here: kzfaq.info/get/bejne/iK15gJd7y9m3m2Q.html And if you wanna add a database: kzfaq.info/get/bejne/n7KkY5OT1taamac.html
@chetanpatel2282
@chetanpatel2282 Жыл бұрын
You tutorial is excellent but I found this tutorial. It can be used for production kzfaq.info/get/bejne/qphxi9xj3pyVn3k.html Sharing this tutorial so that it will be helpful to others. I spent almost 8 hours finding this solution last weekend. Thanks for the tutorial and quick response.
@pixegami
@pixegami Жыл бұрын
@@chetanpatel2282 thanks for sharing!
@josephajibodu2377
@josephajibodu2377 Жыл бұрын
You can use a process manager to keep it running. Just like it’s done in NodeJS. Something like pm2, systemd, or even supervisord The will keep the app running and even restart if it crashes.
@dariusboteand7722
@dariusboteand7722 3 ай бұрын
you missed the step for nginx where you show how to allow connection from firewall..... no wonder it didn't work for me first time I followed your tutorial
@pixegami
@pixegami 3 ай бұрын
Hmm interesting, I must have missed that. Thanks for sharing your discovery!
@anggipermanaharianja6122
@anggipermanaharianja6122 Жыл бұрын
NICE
@steeeif
@steeeif 2 ай бұрын
This videos shows how to test the app but it wont work due to server will be terminated once window is closed..
@pixegami
@pixegami 2 ай бұрын
You can run the command with `&` at the end (on any Unix based terminal) and that should prevent the terminal from shutting down the process when it exits. They can continue to run in the background. But yes, if you want to go to production with this you'll need to quite a bit more work.
@peterkim9696
@peterkim9696 Жыл бұрын
What if you close your terminal in your local linux machine would your fastapi close as well on Amazon AWS?
@pixegami
@pixegami Жыл бұрын
Yup, general closing the SSH connection will also terminate the process. unix.stackexchange.com/questions/422188/sshd-into-a-linux-aws-box-how-to-exit-out-of-terminal-without-closing-script-r To work around it, you have several options. The easiest one is just to run the script as a background task. askubuntu.com/questions/396654/how-to-run-a-python-program-in-the-background-even-after-closing-the-terminal But a better way is to run it as a Daemon or a service, so it starts up with the system, and also restarts if it crashes.
@peterkim9696
@peterkim9696 Жыл бұрын
@@pixegami I want to run it 24/7
@eRiicBelleT
@eRiicBelleT 5 ай бұрын
Can i expose it bia https without a domain?
@user-zb9bp1jt4k
@user-zb9bp1jt4k 6 ай бұрын
Hey, Great content. I have a question, if we stop the ssh session, will the server still be accessible from internet i.e. will the services still work?
@pixegami
@pixegami 6 ай бұрын
Yes, it should be because the FastAPI server will still be running on EC2. However, you can still have the server crash and not recover. So even though this lets you set it up quickly, there's still a lot of work to do to make it resilient. You can also check out my other video on how to host this on AWS Lambda instead, which takes away a huge amount of the server management work you need to do: kzfaq.info/get/bejne/iK15gJd7y9m3m2Q.html
@isthatkhensi
@isthatkhensi 4 ай бұрын
@@pixegami Hi, thanks for the great tutorial. I followed the steps and everything is working. However once I quit running uvicorn on my local terminal, the server gives a 502 error. Could it be my instance settings causing this dependency issue?
@overneos2728
@overneos2728 8 ай бұрын
Hello, I've been wondering, is it possible to use a port different port 80 ? And if you've covered this topic in another video
@pixegami
@pixegami 8 ай бұрын
You can set FastAPI's server itself to a different port, but port 80 is the standard protocol for HTTP so if you want users to be able to access this via HTTP it eventually does need to be routed through 80.
@akhilsharma392
@akhilsharma392 2 ай бұрын
which is better for api deployment ec2 or aws lambda
@justin23262
@justin23262 2 ай бұрын
hi, can i ask? if i shutdown my computer, can people access my api ?
@akhilsharma392
@akhilsharma392 2 ай бұрын
@@justin23262 if its on local host then no If you host it somewhere then yes
@akhilsharma392
@akhilsharma392 2 ай бұрын
@@justin23262 look if you hosted it somewhere and make outpost settings for everywhere then yes anyone can access
@pixegami
@pixegami 2 ай бұрын
Personally, I'd go with Lambda. Better scaling, better availability, less maintenance.
@akhilsharma392
@akhilsharma392 2 ай бұрын
@@pixegami yep I consider lambda also btw I am fresher working with cloud new to me and Thanks for comments it gives me a support
@reocode
@reocode Жыл бұрын
Might look unrelated, but... What's your firefox theme?
@pixegami
@pixegami Жыл бұрын
I don't use any special theme, I think it was just one of the in-built ones suggested my Firefox when I upgraded/downloaded it.
@ApartmentAngelsFireStarters
@ApartmentAngelsFireStarters Жыл бұрын
Hi, love this vid, could you do a deployment video for ec2 or lambda where you deploy to a windows device?
@pixegami
@pixegami Жыл бұрын
Thanks! Although I'm not sure what you mean by deploying to a "Windows" device. Do you mean a EC2/Lambda that runs a Windows OS?
@ApartmentAngelsFireStarters
@ApartmentAngelsFireStarters Жыл бұрын
Nah tbh I just wanted a way to self host my app with a static ip for freez thought ec2 would help out but yeah its all but if there's a way you could possibly display how you could port forward a fastapi app to https that would be a pretty good video, I haven't seen anything like that and I would appreciate it if you made a tutorial showcasing how you'd do that
@pixegami
@pixegami Жыл бұрын
@@ApartmentAngelsFireStarters EC2 will cost money after a year, and a static IP is hard for people to type and remember and it can change if you reboot the server. Also, setting up HTTPS means you have to manage your own certificate and expiry. You'll also have to figure out how to patch and update your host so it doesn't become vulnerable to new attacks. Managing all that is possible, but difficult. That's why if you want to deploy a new app, I recommend going serverless instead. Check out how to deploy FastAPI to AWS Lambda. It's free for 1 million requests per month, and comes with a free HTTPS API endpoint (better than a static IP). If you need to persist data, check out kzfaq.info/get/bejne/n7KkY5OT1taamac.html
@user-vm7od6lq4p
@user-vm7od6lq4p Жыл бұрын
f***ing legend
@leonardorojasquevedo9342
@leonardorojasquevedo9342 Жыл бұрын
Hi good afternoon , one question, I closed the terminal CMD , the api no found why?, the instance do not start?
@pixegami
@pixegami Жыл бұрын
Yeah... that could be the case. If you run the API directly in the terminal, then when you close it, it might also terminate the API. You might need to run it as a background process, or as a daemon (agent).
@princemoronfolu
@princemoronfolu 2 жыл бұрын
Now how do you secure this. Since this is just public facing. Is there any authorization process?
@pixegami
@pixegami 2 жыл бұрын
That's an excellent question - actually I think I'll make a video on the topic of authentication next to cover it. But to specifically answer your question, the API itself will need some sort of auth capability. Anyone can hit the endpoint with a request, but a request must be 'authentic' to be processed (and bad requests rejected with a 401 or 403 error).
@pixegami
@pixegami 2 жыл бұрын
For FastAPI (and serverless APIs specifically) the popular way to do it these days is by using JWT tokens. This means the requester must seen a signed token that proves they are authenticated, and authorized to use the API. The token can only be signed by the auth provider (such as Firebase, Auth0, Clerk, and more), but it can be validated by the anyone who has access to the public key (which your API will). Typically, the token is sent in the HTTP request header under "Authorization". FastAPI has support to deal with this: fastapi.tiangolo.com/features/?h=authentication#security-and-authentication
@pixegami
@pixegami 2 жыл бұрын
Finally, to prevent an attacker from obtaining a token and re-using it to use the API on a victim's behalf, tokens are usually short-lived (they have an expiry time after a few hours). But to get access to a victim's token, the attacker would usually need to have access to the victim's local environment to begin with (e.g. a public computer in a LAN cafe that didn't get logged out).
@princemoronfolu
@princemoronfolu 2 жыл бұрын
Thank you very much for your answer also how do i achieve persistence with my database model. My dat that has been pushed seems to be wiped out after a while
@pixegami
@pixegami 2 жыл бұрын
@@princemoronfolu If you're using Lambda, that's expected because the function is 'created' clean at the start of most invocations. If you're using EC2, then files and things you create should persist, so I'd be surprised if something is wiping it out - maybe there's a script or something that resets it? I don't know. But in either case, you *shouldn't* really be storing your DB model in your compute environment anyways. It is unsafe, difficult to back up, and will not scale. You need a separate service to host your DB, and your compute (whether EC2 or Lambda) and talk to it with API calls. That's the best way to build it.
@nizor_
@nizor_ 2 жыл бұрын
how do i keep fastAPI app running in production?
@pixegami
@pixegami 2 жыл бұрын
Good question. If you follow this AWS EC2 tutorial, you will have a server up very quickly - but it is quite fragile. It doesn't have mechanisms to handle traffic surge, outages, reboots, or host/software patching. If you wanna continue using EC2, you need to add something like a health check and a boot script so that the server restarts when it fails. You might want to put it into auto-scaling group and maybe behind a load-balancer. But if this sounds complicated - then the good news is that there is also a better solution. We can instead deploy FastAPI to something serverless, like AWS Lambda (or AWS Fargate) instead. That will ensure that it is live, scalable and production ready all the time. I'll do a video on that next if people are interested!
@yangwang9688
@yangwang9688 2 жыл бұрын
@@pixegami I’ll be looking forward to seeing the tutorial on Lambda
@pixegami
@pixegami 2 жыл бұрын
@Yang Wang Here's the video with FastAPI on AWS Lambda: kzfaq.info/get/bejne/iK15gJd7y9m3m2Q.html Enjoy!👍
@yangwang9688
@yangwang9688 2 жыл бұрын
@@pixegami I’ve watched the video, this is superb 🤩
@moayadalkhozayem4742
@moayadalkhozayem4742 11 ай бұрын
you should've just mentioned that from the beginning smh...@@pixegami
@juliocesarpereirarocha3976
@juliocesarpereirarocha3976 5 ай бұрын
I used this but give a 404 error in all situations
@priyanshudeshmukh2431
@priyanshudeshmukh2431 Жыл бұрын
Why doesn't ec2 download tensorflow
@cyberpunk6654
@cyberpunk6654 Жыл бұрын
how to make it work over https???????
@panosp5711
@panosp5711 2 жыл бұрын
My friend please highlight that you use python3.8 otherwise with python 3.10 you have to install 3.10
@pixegami
@pixegami 2 жыл бұрын
Thanks for catching that!
@vamsyrraju
@vamsyrraju 11 ай бұрын
how about https?
@pixegami
@pixegami 10 ай бұрын
Hmm, it's pretty complex if you haven't done it before. You need to get a certificate for your app (from where like "LetsEncrypt"), maybe put a NGINX rule (or maybe FastAPI has native HTTPS integration, I'm not sure). Then you'd have to modify the EC2 instance and security groups to allow HTTPS traffic: docs.aws.amazon.com/cloudhsm/latest/userguide/ssl-offload-enable-traffic-and-verify-certificate.html Personally, I don't like to manage any of that stuff myself so I prefer to use something like AWS Lambda for my APIs, then use AWS ApiGateway to manage the endpoint (and configure HTTPS through it instead).
Deploy FastAPI on AWS Lambda ⚡ Serverless hosting!
22:24
pixegami
Рет қаралды 38 М.
How to Deploy ML Solutions with FastAPI, Docker, & AWS
28:48
Shaw Talebi
Рет қаралды 6 М.
If Barbie came to life! 💝
00:37
Meow-some! Reacts
Рет қаралды 52 МЛН
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 21 МЛН
Top 5 High Paying Tech Skills to Learn in 2024
16:10
pixegami
Рет қаралды 14 М.
Is this the BEST Reverse Proxy for Docker? // Traefik Tutorial
21:57
Christian Lempa
Рет қаралды 509 М.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
pixegami
Рет қаралды 261 М.
Deploy FastAPI on Vercel | Quick and Easy Tutorial
6:15
Eric Roby
Рет қаралды 5 М.
Python RAG Tutorial (with Local LLMs): AI For Your PDFs
21:33
pixegami
Рет қаралды 193 М.
Using docker in unusual ways
12:58
Dreams of Code
Рет қаралды 437 М.
Quickly Authenticate Users with FastAPI and Token Authentication
46:05
Akamai Developer
Рет қаралды 103 М.