Class Port
(experimental) Interface for classes that provide the connection-specification parts of a security group rule.
Inheritance
Namespace: Amazon.CDK.AWS.GameLift.Alpha
Assembly: Amazon.CDK.AWS.GameLift.Alpha.dll
Syntax (csharp)
public class Port : DeputyBase
Syntax (vb)
Public Class Port
Inherits DeputyBase
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
Build build;
var fleet = new BuildFleet(this, "Game server fleet", new BuildFleetProps {
FleetName = "test-fleet",
Content = build,
InstanceType = InstanceType.Of(InstanceClass.C4, InstanceSize.LARGE),
RuntimeConfiguration = new RuntimeConfiguration {
ServerProcesses = new [] { new ServerProcess {
LaunchPath = "/local/game/GameLiftExampleServer.x86_64"
} }
},
IngressRules = new [] { new IngressRule {
Source = Peer.AnyIpv4(),
Port = Port.TcpRange(100, 200)
} }
});
// Allowing a specific CIDR for port 1111 on UDP Protocol
fleet.AddIngressRule(Peer.Ipv4("1.2.3.4/32"), Port.Udp(1111));
Synopsis
Constructors
Port(IPortProps) | |
Port(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Port(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
AllTcp() | (experimental) Any TCP traffic. |
AllUdp() | (experimental) Any UDP traffic. |
Tcp(Double) | (experimental) A single TCP port. |
TcpRange(Double, Double) | (experimental) A TCP port range. |
ToJson() | (experimental) Produce the ingress rule JSON for the given connection. |
Udp(Double) | (experimental) A single UDP port. |
UdpRange(Double, Double) | (experimental) A UDP port range. |
Constructors
Port(IPortProps)
Port(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Port(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Port(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Port(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
AllTcp()
(experimental) Any TCP traffic.
public static Port AllTcp()
Returns
Remarks
Stability: Experimental
AllUdp()
(experimental) Any UDP traffic.
public static Port AllUdp()
Returns
Remarks
Stability: Experimental
Tcp(Double)
(experimental) A single TCP port.
public static Port Tcp(double port)
Parameters
- port System.Double
Returns
Remarks
Stability: Experimental
TcpRange(Double, Double)
(experimental) A TCP port range.
public static Port TcpRange(double startPort, double endPort)
Parameters
- startPort System.Double
- endPort System.Double
Returns
Remarks
Stability: Experimental
ToJson()
(experimental) Produce the ingress rule JSON for the given connection.
public virtual object ToJson()
Returns
System.Object
Remarks
Stability: Experimental
Udp(Double)
(experimental) A single UDP port.
public static Port Udp(double port)
Parameters
- port System.Double
Returns
Remarks
Stability: Experimental
UdpRange(Double, Double)
(experimental) A UDP port range.
public static Port UdpRange(double startPort, double endPort)
Parameters
- startPort System.Double
- endPort System.Double
Returns
Remarks
Stability: Experimental