aws-cdk-lib.aws_ecs.PortMap

class PortMap

LanguageType name
.NETAmazon.CDK.AWS.ECS.PortMap
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsecs#PortMap
Javasoftware.amazon.awscdk.services.ecs.PortMap
Pythonaws_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,
  hostPort: 123,
  name: 'name',
  protocol: ecs.Protocol.TCP,
});

Initializer

new PortMap(networkmode: NetworkMode, pm: PortMapping)

Parameters

  • networkmode NetworkMode
  • pm PortMapping

Properties

NameTypeDescription
networkmodeNetworkModeThe networking mode to use for the containers in the task.
portmappingPortMappingPort mappings allow containers to access ports on the host container instance to send or receive traffic.

networkmode

Type: NetworkMode

The networking mode to use for the containers in the task.


portmapping

Type: PortMapping

Port mappings allow containers to access ports on the host container instance to send or receive traffic.

Methods

NameDescription
validate()validate invalid portmapping and networkmode parameters.

validate()

public validate(): void

validate invalid portmapping and networkmode parameters.

throw Error when invalid parameters.