2 Microservices in same subnet AWS

Viewed 202

I have an AWS application that currently has 1 microservice. Back-end traffic goes through CloudFront distribution and load balancer to an EC2 autoscaling group with 2 subnets (A and B) across 2 availability zones.

I would now like to add another microservice and would like to know if the EC2 autoscaling group for the 2nd one should use the same subnets A and B or two new ones C and D?

Also would it use the same load balancer and would they be in the same VPC?

Cheers, Kris

1 Answers

should use the same subnets A and B or two new ones C and D?

Up to you and your requirements. They can use same or different subnets.

Also would it use the same load balancer and would they be in the same VPC?

If you are using ALB, you can define new listener based on the hostname/domain of your second microservice. Create new target group for it and re-use existing ALB.

Related