class Peer
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.GameLift.Alpha.Peer |
Go | github.com/aws/aws-cdk-go/awscdkgameliftalpha/v2#Peer |
Java | software.amazon.awscdk.services.gamelift.alpha.Peer |
Python | aws_cdk.aws_gamelift_alpha.Peer |
TypeScript (source) | @aws-cdk/aws-gamelift-alpha » Peer |
Peer object factories.
The static methods on this object can be used to create peer objects which represent a connection partner in inbound permission rules.
Use this object if you need to represent connection partners using plain IP addresses.
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 Peer()
Methods
Name | Description |
---|---|
static any | Any IPv4 address. |
static ipv4(cidrIp) | Create an IPv4 peer from a CIDR. |
static anyIpv4()
public static anyIpv4(): IPeer
Returns
Any IPv4 address.
static ipv4(cidrIp)
public static ipv4(cidrIp: string): IPeer
Parameters
- cidrIp
string
Returns
Create an IPv4 peer from a CIDR.