Reduce your application cost, by using a single Application Load Balancer with a multi-domain name with Route53 A Record alias using AWS CDK as Infrastructure as Code

So why convert multi Application Load Balancer into a single Application Load Balancer? Every application load balancer you have will cost you $0.0225 hourly or $16.2 monthly just to have an Application Load Balancer, then you will pay for min. 1 LCU to $0.008 hourly or $5.76$ a month so every Application Load Balancer you create will have a minimum cost of $21.92 each month on your total bill cost.

So if you can accept to share your application load balancer with multi-services you can save a lot of dollars in this way I will teach you in this article.

I will create a network with a single NAT gateway, and 2 Availability Zone else our application load balancer won't work, then I will create 2 ECS clusters running a Fargate instance then I will add the application load balancer target groups to our ECS service so the binding on port 80 will go based on the domain down to our ECS cluster domains.

At the end of this article, I will create our AWS Route53 Hosted Zone so it will have an alias for pointing to our application load balancer to point the traffic from the internet down to the right ECS Cluster.

--

--

Paris Nakita Kejser
DevOps Engineer, Software Architect and Software Developering

DevOps Engineer, Software Architect, Software Developer, Data Scientist and identify me as a non-binary person.