AWS ECS : Network Modes and Comparison
In this post, I will discuss the container networking options available with AWS ECS, their applicability and brief comparison.
Container networking refers to the ability for containers to connect to and communicate with each other, or to non-Docker workloads.
This is the definition provided by docker, and it’s applicable for ECS as well.
Lets take an example of a
TODO application which manages the TODO entries. Let say, the
TODO Application is running as an ECS Task. You have another containerized application called
Reminder Application, which takes care of managing the “reminders”. The reminder application is running as a separate
Task. Every time a TODO entry is created with a Reminder,
TODO Application need to connect with the
Reminder Application. Your container or
Task needs to be available for any external communications as well, for instance from a load balancer.
For both internal and external communications, your task instances need to exhibit networking behavior. This behavior is configured by specifying “network mode” which is one of the parameters for “ECS Task Definition”.
Typically, when you access an application or a service running remotely, you need IP address (or the DNS name) and the port number, to access it. The same principle applies to our Task instances as well.
By default, when the task instance is created, the container inside, remains in an isolated zone. You need to enable the network mode, to expose the applications for any communications.