Make application running in ECS accessible to the world on https

Viewed 1459

I have an ECS instance running a web server on port 3000.

I would like to access my app though this url : https://my-domain.com.

This implies:

  • creating a DNS record that points from my-domain.com to the ECS public IP.

  • Having a proxy that has the SSL certificate and forwards inbound connections from port 443 to 3000.

What whould be easiest way to accomplish that ? Do I need to use ELB ?

Thanks

1 Answers

The easiest solution is as you suggested, add an application load balancer that serves a certificate via ACM. The target group would need to be for port 3000, whilst the listener is for HTTPS port 443.

When you configure the ECS service if you register the target group with the ECS service, any future changes (such as addition or removal of containers) will automatically be applied to the target group. This must be applied during creation of the service.

With the ALB no additional requirements (such as proxies) would be required the container would stay private whilst the ALB would be the only public component.

For more information take a read of How can I create an Application Load Balancer and then register Amazon ECS tasks automatically?.

Related