software.amazon.awscdk.services.gamelift.alpha.Port Maven / Gradle / Ivy
Show all versions of gamelift-alpha Show documentation
package software.amazon.awscdk.services.gamelift.alpha;
/**
* (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));
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-12-27T17:02:12.136Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.gamelift.alpha.$Module.class, fqn = "@aws-cdk/aws-gamelift-alpha.Port")
public class Port extends software.amazon.jsii.JsiiObject {
protected Port(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected Port(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Port(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.gamelift.alpha.PortProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* (experimental) Any TCP traffic.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.gamelift.alpha.Port allTcp() {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.gamelift.alpha.Port.class, "allTcp", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.gamelift.alpha.Port.class));
}
/**
* (experimental) Any UDP traffic.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.gamelift.alpha.Port allUdp() {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.gamelift.alpha.Port.class, "allUdp", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.gamelift.alpha.Port.class));
}
/**
* (experimental) A single TCP port.
*
* @param port This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.gamelift.alpha.Port tcp(final @org.jetbrains.annotations.NotNull java.lang.Number port) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.gamelift.alpha.Port.class, "tcp", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.gamelift.alpha.Port.class), new Object[] { java.util.Objects.requireNonNull(port, "port is required") });
}
/**
* (experimental) A TCP port range.
*
* @param startPort This parameter is required.
* @param endPort This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.gamelift.alpha.Port tcpRange(final @org.jetbrains.annotations.NotNull java.lang.Number startPort, final @org.jetbrains.annotations.NotNull java.lang.Number endPort) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.gamelift.alpha.Port.class, "tcpRange", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.gamelift.alpha.Port.class), new Object[] { java.util.Objects.requireNonNull(startPort, "startPort is required"), java.util.Objects.requireNonNull(endPort, "endPort is required") });
}
/**
* (experimental) A single UDP port.
*
* @param port This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.gamelift.alpha.Port udp(final @org.jetbrains.annotations.NotNull java.lang.Number port) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.gamelift.alpha.Port.class, "udp", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.gamelift.alpha.Port.class), new Object[] { java.util.Objects.requireNonNull(port, "port is required") });
}
/**
* (experimental) A UDP port range.
*
* @param startPort This parameter is required.
* @param endPort This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.gamelift.alpha.Port udpRange(final @org.jetbrains.annotations.NotNull java.lang.Number startPort, final @org.jetbrains.annotations.NotNull java.lang.Number endPort) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.gamelift.alpha.Port.class, "udpRange", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.gamelift.alpha.Port.class), new Object[] { java.util.Objects.requireNonNull(startPort, "startPort is required"), java.util.Objects.requireNonNull(endPort, "endPort is required") });
}
/**
* (experimental) Produce the ingress rule JSON for the given connection.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.Object toJson() {
return software.amazon.jsii.Kernel.call(this, "toJson", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
}
/**
* (experimental) A fluent builder for {@link software.amazon.awscdk.services.gamelift.alpha.Port}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create() {
return new Builder();
}
private final software.amazon.awscdk.services.gamelift.alpha.PortProps.Builder props;
private Builder() {
this.props = new software.amazon.awscdk.services.gamelift.alpha.PortProps.Builder();
}
/**
* (experimental) A starting value for a range of allowed port numbers.
*
* For fleets using Windows and Linux builds, only ports 1026-60000 are valid.
*
* @return {@code this}
* @param fromPort A starting value for a range of allowed port numbers. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder fromPort(final java.lang.Number fromPort) {
this.props.fromPort(fromPort);
return this;
}
/**
* (experimental) The protocol for the range.
*
* @return {@code this}
* @param protocol The protocol for the range. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder protocol(final software.amazon.awscdk.services.gamelift.alpha.Protocol protocol) {
this.props.protocol(protocol);
return this;
}
/**
* (experimental) An ending value for a range of allowed port numbers.
*
* Port numbers are end-inclusive.
* This value must be higher than fromPort
.
*
* For fleets using Windows and Linux builds, only ports 1026-60000 are valid.
*
* Default: the `fromPort` value
*
* @return {@code this}
* @param toPort An ending value for a range of allowed port numbers. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder toPort(final java.lang.Number toPort) {
this.props.toPort(toPort);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.awscdk.services.gamelift.alpha.Port}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public software.amazon.awscdk.services.gamelift.alpha.Port build() {
return new software.amazon.awscdk.services.gamelift.alpha.Port(
this.props.build()
);
}
}
}