Reduce cost for streamlit app running in docker container with cloud run and IAP / load balancer

Hi everyone, 

I deployed a streamlit app with IAP for authentication, which requires the use of a load balancer. When I look at my billing, there is a constant charge of EUR 17 per month for networking and EUR 7 for a compute engine in addition to the variable cost of cloud run. I assume that the load balancer, which is required for the IAP, is responsible for the EUR 17 and EUR 7, and I wonder if there is a way to reduce this cost, especially since I would like to deploy several of these and it seems that with every deployment requiring access control trough IAP and a unique static internet address, I will have to insure a 'fixed' cost of EUR 17 + EUR 7 = EUR 24 per month which is prohibitive, especially since the web sites are only used a few times a day, and don't have to deal with any significant scaling (i.e. mostly single access). Any ideas?

0 1 149
1 REPLY 1

Hello @bavquant,

Welcome to the Google Cloud Community!

If you're not heavily invested in using Compute Engine and IAP, you might want to consider deploying your Streamlit apps directly on Cloud Run, with a VPC network. This eliminates the need for a separate load balancer and Compute Engine instance for IAP. Cloud Run  with VPC allows you to configure IAP directly at the Cloud Run service level, reducing overall infrastructure costs.

Moreover, Cloud Run has the ability to scale down to zero when idle, offering potential cost savings for applications experiencing low traffic volumes. Learn more about instance auto-scaling at Cloud Run Instance Auto-scaling . Additionally, Cloud Run supports custom domains, which you can explore at Mapping Custom Domains on Cloud Run.