class PortMap
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ECS.PortMap |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#PortMap |
![]() | software.amazon.awscdk.services.ecs.PortMap |
![]() | aws_cdk.aws_ecs.PortMap |
![]() | 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
Network
Mode - pm
Port
Mapping
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.