Class PortMap

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ecs.PortMap
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.106.0 (build e852934)", date="2025-01-25T00:20:55.084Z") @Stability(Stable) public class PortMap extends software.amazon.jsii.JsiiObject
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 software.amazon.awscdk.services.ecs.*;
 AppProtocol appProtocol;
 PortMap portMap = PortMap.Builder.create(NetworkMode.NONE)
         .containerPort(123)
         // the properties below are optional
         .appProtocol(appProtocol)
         .containerPortRange("containerPortRange")
         .hostPort(123)
         .name("name")
         .protocol(Protocol.TCP)
         .build();
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A fluent builder for PortMap.

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    PortMap(NetworkMode networkmode, PortMapping pm)
     
    protected
    PortMap(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    PortMap(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    The networking mode to use for the containers in the task.
    Port mappings allow containers to access ports on the host container instance to send or receive traffic.
    void
    validate invalid portmapping and networkmode parameters.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • PortMap

      protected PortMap(software.amazon.jsii.JsiiObjectRef objRef)
    • PortMap

      protected PortMap(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • PortMap

      @Stability(Stable) public PortMap(@NotNull NetworkMode networkmode, @NotNull PortMapping pm)
      Parameters:
      networkmode - This parameter is required.
      pm - This parameter is required.
  • Method Details

    • validate

      @Stability(Stable) public void validate()
      validate invalid portmapping and networkmode parameters.

      throw Error when invalid parameters.

    • getNetworkmode

      @Stability(Stable) @NotNull public NetworkMode getNetworkmode()
      The networking mode to use for the containers in the task.
    • getPortmapping

      @Stability(Stable) @NotNull public PortMapping getPortmapping()
      Port mappings allow containers to access ports on the host container instance to send or receive traffic.