AWS ALB and Render.com Deployment
In the previous blog RAG Chatbot: AWS Deployment, we walked through deploying a RAG chatbot using AWS ECS Fargate. This time, we’ll take it a step further by setting an Application Load Balancer (ALB) for a stable, production-ready endpoint, and we’ll also look at a simpler alternative on Render.com.
Application Load Balancer (ALB)
The app is currently deployed with an IP address assigned to the running task of the ECS service. Once that task is stopped or terminated, the IP address changes, breaking any clients pointing to it.
To avoid this issue, we can use an Application Load Balancer (ALB) to provide a stable DNS name that always routes to the right task.
Setting Up the ALB
First, just like we did in the previous blog, make sure you already have the following:
- An ECS Cluster
- A running service using Fargate (you might need to recreate one that accepts an ALB)
- The ECS task exposing port 8000 (or whatever port your application uses)
- A VPC with at least two subnets in different Availability Zones (AZs)
Creating the ALB
First, you need to create a Target Group:
- Go to EC2 -> Target Groups
- Click “Create target group”
- Choose:
- Target type: IP
- Protocol: HTTP
- Port: 8000 (or whatever port your application uses)
- VPC: Select the VPC you created earlier
- Click Next, skip registering targets for now
- Name it
chatbot-api-tg
- Click “Create target group”
Now, to create the ALB:
- Go to EC2 -> Load Balancers
- Click “Create Load Balancer” -> “Application Load Balancer”
- Set:
- Name:
chatbot-api-alb
- Scheme: Internet-facing
- IP address type: IPv4
- Name:
- Select at least two public subnets in different AZs
- Security Group:
- Either create a new SG or use the existing one
- Allow Inbound HTTP (port 80) from anywhere
- Listener:
- Create a listener on HTTP:80
- Default action: Forward to
chatbot-api-tg
- Click “Create Load Balancer”
Once the ALB is created, you can update the ECS service to use it.
You might not be able to add the ALB to the existing service if it was not set up to use one initially. In this case you will need to recreate the ECS service with the ALB configuration.
Whether you updated the existing service or recreated it, you have to set up the load balancer:
- Select
Application Load Balancer
- Choose the ALB you created earlier
- Listener: choose
HTTP: 80
- Target group: choose
chatbot-api-tg
, type:ip
, and port: 8000 - Health check path: Use
/health
or any simple endpoint that returns 200 (e.g./
)
After setting up the load balancer, you should be able to access your chatbot using the ALB’s DNS name.
The DNS name can be found in the AWS Management Console under the EC2 section, in the Load Balancers page, it looks like this:
chatbot-api-alb-1234567890.eu-north-1.elb.amazonaws.com
You can use this DNS name to access your chatbot through the ALB:
In
.env
, setCHATBOT_API_URL
tohttp://chatbot-api-alb-1234567890.eu-north-1.elb.amazonaws.com/chat
If all goes well, you should now be able to access your chatbot through the ALB. You can stop the task, then restart it, you will not need to update anything in the app.
A Quick Reality Check
I have to admit this wasn’t easy, following the above is actually hard if you’re a beginner. I stumbled a lot while setting this up, and I hope this guide helps you avoid some of the mistakes I made.
For instance, I had to recreate the ECS service because I couldn’t find the ALB configuration when editing. I also somehow ended up creating two load balancers and trying to use the one that is not attached to any service, which was a waste of time.
So, if you find the above difficult to follow, or simply unclear, don’t worry, this is completely normal.
Deploying on Render.com
After wrestling with AWS, I developed a great appreciation and admiration for the AWS wizards that I’ve worked with. I didn’t like how costly AWS was either, so I started looking for alternatives.
That’s how I discovered Render.com.
No, I’m not sponsored by them, although I wish that was the case!
This platform is amazing, it is much easier to deploy applications compared to AWS, it also has a free tier that allows you to test deploying your applications without any costs whatsoever.
It also solves the problem that necessitated the use of an ALB in the first place.
Because Render generates a unique domain for each service, you don’t need to worry about setting up a load balancer manually.
How to deploy on Render.com
- Sign up for a free account on Render.com.
- Create a new web service.
- Connect your GitHub repository containing the chatbot code.
- Set the build command (if needed) and the start command (e.g.,
python app.py
). - Set the environment variables, such as the AI API keys and the database connection string.
- Choose the free plan and click “Create Web Service”.
Render will automatically handle the deployment, and you will get a unique URL for your service.
If anything goes wrong during deployment, the logs are quite easy to understand, if you could handle AWS, Render will feel like a child’s play.
Comparison
While AWS provides powerful tools for managing your infrastructure, it can be complex and challenging for beginners.
Render.com offers a simpler alternative that abstracts away much of the complexity, allowing you to focus on building your application.
Feature / Factor | AWS (with ALB) | Render.com |
---|---|---|
Ease of Setup | Steep learning curve, multiple services to configure | Very straightforward, deploy in minutes |
Deployment Speed | Slower: requires manual setup of ECS, ALB, networking | Faster: connect repo, set commands, done |
Scalability | Highly scalable with fine-grained control | Scales automatically, but fewer configuration options |
Cost | Pay-as-you-go, can get expensive for small projects | Free tier for small apps; predictable paid plans |
Custom Domains | Supported, requires Route 53 or similar | Supported, built-in with SSL |
Load Balancing | Requires manual setup (ALB, target groups, listeners) | Automatic: each service gets its own stable URL |
Flexibility | Extremely flexible, can integrate with hundreds of AWS services | More limited feature set, focused on simplicity |
Learning Value | Great for learning cloud infrastructure | Great for quick prototyping and MVPs |
Best For | Production-grade apps needing advanced networking and infrastructure control | Developers who want fast deployment with minimal configuration |
Which should you choose?
If you’re building a production-grade application that needs advanced networking, fine-grained scaling, or integration with a wide range of cloud services, AWS with an ALB is worth the extra effort. You’ll get enterprise-level reliability at the cost of complexity.
If speed, simplicity, and lower costs matter more, especially for prototypes, MVPs, or personal projects, Render.com is the clear winner. In many cases, you can even start on Render and later migrate to AWS when your infrastructure needs grow.