Amazon Elastic Container Service TaskDefinition PortMapping
PortMappings is a property of the Amazon Elastic Container Service TaskDefinition ContainerDefinition property that maps
a container port to a host port.
Syntax
JSON
{ "ContainerPort" :Integer, "HostPort" :Integer, "Protocol" :String}
YAML
ContainerPort:IntegerHostPort:IntegerProtocol:String
Properties
For more information about each property, see Task Definition Parameters in the Amazon Elastic Container Service Developer Guide.
ContainerPort-
The port number on the container bound to the host port.
Required: Yes
Type: Integer
HostPort-
The host port number on the container instance that you want to reserve for your container. You can specify a non-reserved host port for your container port mapping, omit the host port, or set the host port to
0. If you specify a container port but no host port, your container host port is assigned automatically .Don't specify a host port in the
49153to65535port range; these ports are reserved for automatic assignment. Other reserved ports include22for SSH,2375and2376for Docker, and51678for the Amazon Elastic Container Service container agent. Don't specify a host port that is being used for a task—that port is reserved while the task is running.Required: No
Type: Integer
Protocol-
The protocol used for the port mapping. For valid values, see the
protocolparameter in the Amazon Elastic Container Service Developer Guide. By default, AWS CloudFormation specifiestcp.Required: No
Type: String
