1

This is the first project I'm deploying in AWS and I'm really struggling with how things work. Stack Overflow wasn't the right place for this question so hopefully, this one will be.

I currently have an application running on Docker in an EC2 instance, perhaps that container will be eventually run in ECS depending on what is decided. The Node API is currently running in HTTP and it is going to be consumed by both a SPA which is hosted in Firebase and only allows connections with HTTPS. Is AWS Elastic Load Balancer + AWS Certificate Manager with Public Certificate able to do the job for me in both EC2 and ECS situations? If yes, can Load Balancer point to multiple APIs and will I need more than one certificate/domain for each one? Thank you in advance for your attention.

2

Instead of ELB (Elastic Load Balancer) consider ALB (Application Load Balancer) - it is generally cheaper and more flexible.

Yes you can have a certificate from AWS Certificate Manager and terminate SSL on the ALB. The ALB can then talk to your docker container over plain HTTP (non-SSL). If you use ECS (and you should!) it can register the containers with ALB automatically.

ALB has a concept of Target Groups where you can have different content providers, e.g. different API containers, behind a single load balancer. They will differ by paths, e.g. /api1/... and /api2/..., but will share the same host name. That also means you'll get away with a single ACM certificate.

Hope that helps :)

1
  • Thank you so much for the detailed explanation. I could imagine that there would be better options but AWS offers so many services that it is a bit overwhelming to me right now. I will go with that, it seems like the best approach to what we need. :) – Tomás Fonseca Apr 9 '19 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.