I am trying to create a new EC2 based ECS task definition using the new ECS console (https://ap-south-1.console.aws.amazon.com/ecs/v2/task-definitions?region=ap-south-1). But in the port mapping section (which is part of Step 1) I only see the option to set Container port. I want this for an nginx container so container port 80 is fine, but I don't see any option to change host port (to 8080 for example).
When I go to the next step I see Fargate is chosen as the default app environment. I change that to EC2 only and go to create the definition. It creates the definition with host port as 80 as well. If I try to create a new revision I see the same options as above and no way to change host port.
Is this just something that's not been implemented in the new console design ? Or am I missing something here ? As I see the proper options to change host port in the classic UI. Additionally, with this new UI I'm also not able to change things like network (defaults to awsvpc). It seems like this UI is geared completely to a Fargate type of application since all these options I talk about are not required to be configured for Fargate (as per my knowledge).
Thanks!
Unfortunately you cannot set host port, because the new ECS V2 console currently supports only awsvpc
for the network mode.
From the console if we click the Info
link:
The new Amazon ECS console experience currently only supports the
awsvpc
network mode, which provides the task with an elastic network interface (ENI).
For the awsvpc
network mode, you can set only the container port, since this will be exposed through an ENI to your VPC. You would need bridge
mode for being able to configure both the container and host ports.
The V2 console at this point is lacking in functionality compared to the older one. You would want to stick with the older one.