- Newest
- Most votes
- Most comments
Hello.
If the network type is "awsvpc" for EC2 launch type ECS, you cannot set a public IP address.
So, if you need a public IP, I think you need to set the network mode to host mode or bridge mode.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking-awsvpc.html
When hosting tasks that use the awsvpc network mode on Amazon EC2 Linux instances, your task ENIs aren't given public IP addresses. To access the internet, tasks must be launched in a private subnet that's configured to use a NAT gateway. For more information, see NAT gateways in the Amazon VPC User Guide. Inbound network access must be from within a VPC that uses the private IP address or routed through a load balancer from within the VPC. Tasks that are launched within public subnets do not have access to the internet.
Relevant content
- asked a month ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 years ago