java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.gamelift.alpha.Port
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-08-15T01:32:57.027Z") @Stability(Experimental) public class Port extends software.amazon.jsii.JsiiObject
(experimental) Interface for classes that provide the connection-specification parts of a security group rule.

Example:

 Build build;
 BuildFleet fleet = BuildFleet.Builder.create(this, "Game server fleet")
         .fleetName("test-fleet")
         .content(build)
         .instanceType(InstanceType.of(InstanceClass.C4, InstanceSize.LARGE))
         .runtimeConfiguration(RuntimeConfiguration.builder()
                 .serverProcesses(List.of(ServerProcess.builder()
                         .launchPath("/local/game/GameLiftExampleServer.x86_64")
                         .build()))
                 .build())
         .ingressRules(List.of(IngressRule.builder()
                 .source(Peer.anyIpv4())
                 .port(Port.tcpRange(100, 200))
                 .build()))
         .build();
 // Allowing a specific CIDR for port 1111 on UDP Protocol
 fleet.addIngressRule(Peer.ipv4("1.2.3.4/32"), Port.udp(1111));
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    (experimental) A fluent builder for Port.

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

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

    Constructors
    Modifier
    Constructor
    Description
     
    Port(PortProps props)
     
    protected
    Port(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    Port(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Port
    (experimental) Any TCP traffic.
    static Port
    (experimental) Any UDP traffic.
    static Port
    tcp(Number port)
    (experimental) A single TCP port.
    static Port
    tcpRange(Number startPort, Number endPort)
    (experimental) A TCP port range.
    (experimental) Produce the ingress rule JSON for the given connection.
    static Port
    udp(Number port)
    (experimental) A single UDP port.
    static Port
    udpRange(Number startPort, Number endPort)
    (experimental) A UDP port range.

    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

    • Port

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

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

      @Stability(Experimental) public Port(@NotNull PortProps props)
      Parameters:
      props - This parameter is required.
  • Method Details

    • allTcp

      @Stability(Experimental) @NotNull public static Port allTcp()
      (experimental) Any TCP traffic.
    • allUdp

      @Stability(Experimental) @NotNull public static Port allUdp()
      (experimental) Any UDP traffic.
    • tcp

      @Stability(Experimental) @NotNull public static Port tcp(@NotNull Number port)
      (experimental) A single TCP port.

      Parameters:
      port - This parameter is required.
    • tcpRange

      @Stability(Experimental) @NotNull public static Port tcpRange(@NotNull Number startPort, @NotNull Number endPort)
      (experimental) A TCP port range.

      Parameters:
      startPort - This parameter is required.
      endPort - This parameter is required.
    • udp

      @Stability(Experimental) @NotNull public static Port udp(@NotNull Number port)
      (experimental) A single UDP port.

      Parameters:
      port - This parameter is required.
    • udpRange

      @Stability(Experimental) @NotNull public static Port udpRange(@NotNull Number startPort, @NotNull Number endPort)
      (experimental) A UDP port range.

      Parameters:
      startPort - This parameter is required.
      endPort - This parameter is required.
    • toJson

      @Stability(Experimental) @NotNull public Object toJson()
      (experimental) Produce the ingress rule JSON for the given connection.