class PortMap
| Language | Type name | 
|---|---|
|  .NET | Amazon.CDK.AWS.ECS.PortMap | 
|  Go | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#PortMap | 
|  Java | software.amazon.awscdk.services.ecs.PortMap | 
|  Python | aws_cdk.aws_ecs.PortMap | 
|  TypeScript (source) | aws-cdk-lib»aws_ecs»PortMap | 
PortMap ValueObjectClass having by ContainerDefinition.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
declare const appProtocol: ecs.AppProtocol;
const portMap = new ecs.PortMap(ecs.NetworkMode.NONE, {
  containerPort: 123,
  // the properties below are optional
  appProtocol: appProtocol,
  containerPortRange: 'containerPortRange',
  hostPort: 123,
  name: 'name',
  protocol: ecs.Protocol.TCP,
});
Initializer
new PortMap(networkmode: NetworkMode, pm: PortMapping)
Parameters
- networkmode NetworkMode 
- pm PortMapping 
Properties
| Name | Type | Description | 
|---|---|---|
| networkmode | Network | The networking mode to use for the containers in the task. | 
| portmapping | Port | Port mappings allow containers to access ports on the host container instance to send or receive traffic. | 
networkmode
Type:
Network
The networking mode to use for the containers in the task.
portmapping
Type:
Port
Port mappings allow containers to access ports on the host container instance to send or receive traffic.
Methods
| Name | Description | 
|---|---|
| validate() | validate invalid portmapping and networkmode parameters. | 
validate()
public validate(): void
validate invalid portmapping and networkmode parameters.
throw Error when invalid parameters.
