TaskDefinitionPortMappingArgs

data class TaskDefinitionPortMappingArgs(val appProtocol: Output<TaskDefinitionPortMappingAppProtocol>? = null, val containerPort: Output<Int>? = null, val containerPortRange: Output<String>? = null, val hostPort: Output<Int>? = null, val name: Output<String>? = null, val protocol: Output<String>? = null) : ConvertibleToJava<TaskDefinitionPortMappingArgs>

The `PortMapping` property specifies a port mapping. Port mappings allow containers to access ports on the host container instance to send or receive traffic. Port mappings are specified as part of the container definition. If you are using containers in a task with the `awsvpc` or `host` network mode, exposed ports should be specified using `containerPort`. The `hostPort` can be left blank or it must be the same value as the `containerPort`. After a task reaches the `RUNNING` status, manual and automatic host and container port assignments are visible in the `networkBindings` section of DescribeTasks API responses.

Constructors

Link copied to clipboard
constructor(appProtocol: Output<TaskDefinitionPortMappingAppProtocol>? = null, containerPort: Output<Int>? = null, containerPortRange: Output<String>? = null, hostPort: Output<Int>? = null, name: Output<String>? = null, protocol: Output<String>? = null)

Properties

Link copied to clipboard

The application protocol that's used for the port mapping. This parameter only applies to Service Connect. We recommend that you set this parameter to be consistent with the protocol that your application uses. If you set this parameter, Amazon ECS adds protocol-specific connection handling to the Service Connect proxy. If you set this parameter, Amazon ECS adds protocol-specific telemetry in the Amazon ECS console and CloudWatch. If you don't set a value for this parameter, then TCP is used. However, Amazon ECS doesn't add protocol-specific telemetry for TCP. `appProtocol` is immutable in a Service Connect service. Updating this field requires a service deletion and redeployment. Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide.

Link copied to clipboard
val containerPort: Output<Int>? = null

The port number on the container that's bound to the user-specified or automatically assigned host port. If you use containers in a task with the `awsvpc` or `host` network mode, specify the exposed ports using `containerPort`. If you use containers in a task with the `bridge` network mode and you specify a container port and not a host port, your container automatically receives a host port in the ephemeral port range. For more information, see `hostPort`. Port mappings that are automatically assigned in this way do not count toward the 100 reserved ports limit of a container instance.

Link copied to clipboard
val containerPortRange: Output<String>? = null

The port number range on the container that's bound to the dynamically mapped host port range. The following rules apply when you specify a `containerPortRange`:

Link copied to clipboard
val hostPort: Output<Int>? = null

The port number on the container instance to reserve for your container. If you specify a `containerPortRange`, leave this field empty and the value of the `hostPort` is set as follows:

Link copied to clipboard
val name: Output<String>? = null

The name that's used for the port mapping. This parameter only applies to Service Connect. This parameter is the name that you use in the `serviceConnectConfiguration` of a service. The name can include up to 64 characters. The characters can include lowercase letters, numbers, underscores (_), and hyphens (-). The name can't start with a hyphen. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide.

Link copied to clipboard
val protocol: Output<String>? = null

The protocol used for the port mapping. Valid values are `tcp` and `udp`. The default is `tcp`. `protocol` is immutable in a Service Connect service. Updating this field requires a service deletion and redeployment.

Functions

Link copied to clipboard
open override fun toJava(): TaskDefinitionPortMappingArgs