Skip to content
v2.277.0

Experimental

@aws-cdk/aws-gamelift-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

PriorityType Enum ​

Priority to condider when placing new game sessions.

Example ​

ts
declare const fleet: gamelift.BuildFleet;
declare const topic: sns.Topic;

new gamelift.GameSessionQueue(this, 'MyGameSessionQueue', {
      gameSessionQueueName: 'test-gameSessionQueue',
      customEventData: 'test-event-data',
      allowedLocations: ['eu-west-1', 'eu-west-2'],
      destinations: [fleet],
      notificationTarget: topic,
      playerLatencyPolicies: [{
        maximumIndividualPlayerLatency: Duration.millis(100),
        policyDuration: Duration.seconds(300),
      }],
      priorityConfiguration: {
        locationOrder: [
          'eu-west-1',
          'eu-west-2',
        ],
        priorityOrder: [
          gamelift.PriorityType.LATENCY,
          gamelift.PriorityType.COST,
          gamelift.PriorityType.DESTINATION,
          gamelift.PriorityType.LOCATION,
        ],
      },
      timeout: Duration.seconds(300),
    });
python
# fleet: gamelift.BuildFleet
# topic: sns.Topic


gamelift.GameSessionQueue(self, "MyGameSessionQueue",
    game_session_queue_name="test-gameSessionQueue",
    custom_event_data="test-event-data",
    allowed_locations=["eu-west-1", "eu-west-2"],
    destinations=[fleet],
    notification_target=topic,
    player_latency_policies=[gamelift.PlayerLatencyPolicy(
        maximum_individual_player_latency=Duration.millis(100),
        policy_duration=Duration.seconds(300)
    )],
    priority_configuration=gamelift.PriorityConfiguration(
        location_order=["eu-west-1", "eu-west-2"
        ],
        priority_order=[gamelift.PriorityType.LATENCY, gamelift.PriorityType.COST, gamelift.PriorityType.DESTINATION, gamelift.PriorityType.LOCATION
        ]
    ),
    timeout=Duration.seconds(300)
)
java
BuildFleet fleet;
Topic topic;


GameSessionQueue.Builder.create(this, "MyGameSessionQueue")
        .gameSessionQueueName("test-gameSessionQueue")
        .customEventData("test-event-data")
        .allowedLocations(List.of("eu-west-1", "eu-west-2"))
        .destinations(List.of(fleet))
        .notificationTarget(topic)
        .playerLatencyPolicies(List.of(PlayerLatencyPolicy.builder()
                .maximumIndividualPlayerLatency(Duration.millis(100))
                .policyDuration(Duration.seconds(300))
                .build()))
        .priorityConfiguration(PriorityConfiguration.builder()
                .locationOrder(List.of("eu-west-1", "eu-west-2"))
                .priorityOrder(List.of(PriorityType.LATENCY, PriorityType.COST, PriorityType.DESTINATION, PriorityType.LOCATION))
                .build())
        .timeout(Duration.seconds(300))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.GameLift.Alpha
BuildFleet fleet;
Topic topic;


new GameSessionQueue(this, "MyGameSessionQueue", new GameSessionQueueProps {
    GameSessionQueueName = "test-gameSessionQueue",
    CustomEventData = "test-event-data",
    AllowedLocations = new [] { "eu-west-1", "eu-west-2" },
    Destinations = new [] { fleet },
    NotificationTarget = topic,
    PlayerLatencyPolicies = new [] { new PlayerLatencyPolicy {
        MaximumIndividualPlayerLatency = Duration.Millis(100),
        PolicyDuration = Duration.Seconds(300)
    } },
    PriorityConfiguration = new PriorityConfiguration {
        LocationOrder = new [] { "eu-west-1", "eu-west-2" },
        PriorityOrder = new [] { PriorityType.LATENCY, PriorityType.COST, PriorityType.DESTINATION, PriorityType.LOCATION }
    },
    Timeout = Duration.Seconds(300)
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkgameliftalpha/v2
var fleet BuildFleet
var topic Topic


gamelift.NewGameSessionQueue(this, jsii.String("MyGameSessionQueue"), &GameSessionQueueProps{
	GameSessionQueueName: jsii.String("test-gameSessionQueue"),
	CustomEventData: jsii.String("test-event-data"),
	AllowedLocations: []*string{
		jsii.String("eu-west-1"),
		jsii.String("eu-west-2"),
	},
	Destinations: []IGameSessionQueueDestination{
		fleet,
	},
	NotificationTarget: topic,
	PlayerLatencyPolicies: []PlayerLatencyPolicy{
		&PlayerLatencyPolicy{
			MaximumIndividualPlayerLatency: awscdk.Duration_Millis(jsii.Number(100)),
			PolicyDuration: awscdk.Duration_Seconds(jsii.Number(300)),
		},
	},
	PriorityConfiguration: &PriorityConfiguration{
		LocationOrder: []*string{
			jsii.String("eu-west-1"),
			jsii.String("eu-west-2"),
		},
		PriorityOrder: []PriorityType{
			gamelift.PriorityType_LATENCY,
			gamelift.PriorityType_COST,
			gamelift.PriorityType_DESTINATION,
			gamelift.PriorityType_LOCATION,
		},
	},
	Timeout: awscdk.Duration_*Seconds(jsii.Number(300)),
})

Members ​

MemberDescription
LATENCYFleetIQ prioritizes locations where the average player latency (provided in each game session request) is lowest.
COSTFleetIQ prioritizes destinations with the lowest current hosting costs.
DESTINATIONFleetIQ prioritizes based on the order that destinations are listed in the queue configuration.
LOCATIONFleetIQ prioritizes based on the provided order of locations, as defined in LocationOrder.

Referenced by ​