class Port
| Language | Type name | 
|---|---|
  .NET | Amazon.CDK.AWS.GameLift.Alpha.Port | 
  Go | github.com/aws/aws-cdk-go/awscdkgameliftalpha/v2#Port | 
  Java | software.amazon.awscdk.services.gamelift.alpha.Port | 
  Python | aws_cdk.aws_gamelift_alpha.Port | 
  TypeScript (source) | @aws-cdk/aws-gamelift-alpha ยป Port | 
Interface for classes that provide the connection-specification parts of a security group rule.
Example
declare const build: gamelift.Build;
const fleet = new gamelift.BuildFleet(this, 'Game server fleet', {
  fleetName: 'test-fleet',
  content: build,
  instanceType: ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE),
  runtimeConfiguration: {
    serverProcesses: [{
      launchPath: '/local/game/GameLiftExampleServer.x86_64',
    }]
  },
  ingressRules: [{
    source: gamelift.Peer.anyIpv4(),
    port: gamelift.Port.tcpRange(100, 200),
  }]
});
// Allowing a specific CIDR for port 1111 on UDP Protocol
fleet.addIngressRule(gamelift.Peer.ipv4('1.2.3.4/32'), gamelift.Port.udp(1111));
Initializer
new Port(props: PortProps)
Parameters
- props 
PortProps  
Methods
| Name | Description | 
|---|---|
| to | Produce the ingress rule JSON for the given connection. | 
| static all | Any TCP traffic. | 
| static all | Any UDP traffic. | 
| static tcp(port) | A single TCP port. | 
| static tcp | A TCP port range. | 
| static udp(port) | A single UDP port. | 
| static udp | A UDP port range. | 
toJson() 
public toJson(): any
Returns
any
Produce the ingress rule JSON for the given connection.
static allTcp() 
public static allTcp(): Port
Returns
Any TCP traffic.
static allUdp() 
public static allUdp(): Port
Returns
Any UDP traffic.
static tcp(port)
public static tcp(port: number): Port
Parameters
- port 
number 
Returns
A single TCP port.
static tcpRange(startPort, endPort) 
public static tcpRange(startPort: number, endPort: number): Port
Parameters
- startPort 
number - endPort 
number 
Returns
A TCP port range.
static udp(port)
public static udp(port: number): Port
Parameters
- port 
number 
Returns
A single UDP port.
static udpRange(startPort, endPort) 
public static udpRange(startPort: number, endPort: number): Port
Parameters
- startPort 
number - endPort 
number 
Returns
A UDP port range.

 .NET
 Go
 Java
 Python
 TypeScript (