@aws-cdk_aws-gamelift-alpha.Port

class Port ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.GameLift.Alpha.Port
Gogithub.com/aws/aws-cdk-go/awscdkgameliftalpha/v2#Port
Javasoftware.amazon.awscdk.services.gamelift.alpha.Port
Pythonaws_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

NameDescription
toJson()๐Ÿ”นProduce the ingress rule JSON for the given connection.
static allTcp()๐Ÿ”นAny TCP traffic.
static allUdp()๐Ÿ”นAny UDP traffic.
static tcp(port)๐Ÿ”นA single TCP port.
static tcpRange(startPort, endPort)๐Ÿ”นA TCP port range.
static udp(port)๐Ÿ”นA single UDP port.
static udpRange(startPort, endPort)๐Ÿ”น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

  • Port

Any TCP traffic.


static allUdp()๐Ÿ”น

public static allUdp(): Port

Returns

  • Port

Any UDP traffic.


static tcp(port)๐Ÿ”น

public static tcp(port: number): Port

Parameters

  • port number

Returns

  • Port

A single TCP port.


static tcpRange(startPort, endPort)๐Ÿ”น

public static tcpRange(startPort: number, endPort: number): Port

Parameters

  • startPort number
  • endPort number

Returns

  • Port

A TCP port range.


static udp(port)๐Ÿ”น

public static udp(port: number): Port

Parameters

  • port number

Returns

  • Port

A single UDP port.


static udpRange(startPort, endPort)๐Ÿ”น

public static udpRange(startPort: number, endPort: number): Port

Parameters

  • startPort number
  • endPort number

Returns

  • Port

A UDP port range.