Port
- class aws_cdk.aws_gamelift_alpha.Port(*, from_port, protocol, to_port=None)
Bases:
object
(experimental) Interface for classes that provide the connection-specification parts of a security group rule.
- Stability:
experimental
- ExampleMetadata:
infused
Example:
# build: gamelift.Build fleet = gamelift.BuildFleet(self, "Game server fleet", fleet_name="test-fleet", content=build, instance_type=ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE), runtime_configuration=gamelift.RuntimeConfiguration( server_processes=[gamelift.ServerProcess( launch_path="/local/game/GameLiftExampleServer.x86_64" )] ), ingress_rules=[gamelift.IngressRule( source=gamelift.Peer.any_ipv4(), port=gamelift.Port.tcp_range(100, 200) )] ) # Allowing a specific CIDR for port 1111 on UDP Protocol fleet.add_ingress_rule(gamelift.Peer.ipv4("1.2.3.4/32"), gamelift.Port.udp(1111))
- Parameters:
from_port (
Union
[int
,float
]) – (experimental) A starting value for a range of allowed port numbers. For fleets using Windows and Linux builds, only ports 1026-60000 are valid.protocol (
Protocol
) – (experimental) The protocol for the range.to_port (
Union
[int
,float
,None
]) – (experimental) An ending value for a range of allowed port numbers. Port numbers are end-inclusive. This value must be higher thanfromPort
. For fleets using Windows and Linux builds, only ports 1026-60000 are valid. Default: thefromPort
value
- Stability:
experimental
Methods
- to_json()
(experimental) Produce the ingress rule JSON for the given connection.
- Stability:
experimental
- Return type:
Any
Static Methods
- classmethod tcp(port)
(experimental) A single TCP port.
- Parameters:
port (
Union
[int
,float
]) –- Stability:
experimental
- Return type:
- classmethod tcp_range(start_port, end_port)
(experimental) A TCP port range.
- Parameters:
start_port (
Union
[int
,float
]) –end_port (
Union
[int
,float
]) –
- Stability:
experimental
- Return type:
- classmethod udp(port)
(experimental) A single UDP port.
- Parameters:
port (
Union
[int
,float
]) –- Stability:
experimental
- Return type: