Deploy your Streamlit app at scale to AWS Fargate using AWS CDK

Hi everyone,

I’ve just created this Git repo where I’m trying to show step by step how you can take your demo.ipynb, create an Streamlit app, package into a container image, and then deploy everything to AWS Fargate (serverless managed containers). That means that once you are done with the tutorial, you will have an app with: it’s own VPC, ECS Cluster, Application Load Balancer with a public-facing DNS, Auto-scaling, can talk to other AWS services, and that you can quickly edit and re-deploy.

Let me know your thoughts and any idea/comment on how to improve it.



Wow, that’s a really thorough demo @nicolasmetallo, thanks for sharing that! I hope to have a little time later to day to actually walk through this in detail :slight_smile:

Very nice! I hadn’t used Fargate before, only EC2 and EKS. After a quick read I now want to find some time to give it a try!

1 Like

Cool. Does this support GPU inference?

Hi, you can specify the type of instance you want to run your ECS cluster on when you are writing your AWS CDK script, so I don’t see why it wouldn’t support GPU inference :slight_smile:.

1 Like

I’ve also riffed on @nicolasmetallo’s project and streamlined it a bit. You can try it out with a single command:

git clone && cd streamlit-cdk-fargate && make deploy-streamlit

Check it out here

1 Like

That’s amazing @tzaffi! I’ll have a go at it during the week. Nice work :slight_smile:. Quick update on teh previous question by @avn3r, Fargate doesn’t support GPU instances as of now, but you can choose to deploy onto a cluster of EC2 instances instead.

1 Like

Sorry for bumping an old thread, but I was wondering if you guys had seen any issues where lots of users connect to the app at the same time. Does streamlit handle that well currently in your experience?