Skip to content
GitHubXDiscord

MatchmakingConfiguration

The MatchmakingConfiguration resource allows you to manage AWS GameLift MatchmakingConfigurations for creating and managing multiplayer game sessions. This resource provides various properties that define the matchmaking settings, including game properties and player count configurations.

Create a basic matchmaking configuration with required properties and a few optional settings.

import AWS from "alchemy/aws/control";
const matchmakingConfig = await AWS.GameLift.MatchmakingConfiguration("basicMatchmakingConfig", {
name: "BasicMatchmaking",
ruleSetName: "defaultRuleSet",
requestTimeoutSeconds: 30,
acceptanceRequired: true,
additionalPlayerCount: 2,
gameProperties: [
{
key: "GameMode",
value: "TeamDeathmatch"
}
]
});

Configure a matchmaking setup with advanced settings including notifications and custom event data.

const advancedMatchmakingConfig = await AWS.GameLift.MatchmakingConfiguration("advancedMatchmakingConfig", {
name: "AdvancedMatchmaking",
ruleSetName: "advancedRuleSet",
requestTimeoutSeconds: 60,
acceptanceRequired: true,
notificationTarget: "arn:aws:sns:us-west-2:123456789012:MySNSTopic",
customEventData: JSON.stringify({ eventType: "MatchmakingStarted" }),
gameProperties: [
{
key: "GameMode",
value: "CaptureTheFlag"
}
],
gameSessionData: "sessionDataExample"
});

Create a matchmaking configuration that uses backfill mode to allow new players to join existing game sessions.

const backfillMatchmakingConfig = await AWS.GameLift.MatchmakingConfiguration("backfillMatchmakingConfig", {
name: "BackfillMatchmaking",
ruleSetName: "backfillRuleSet",
requestTimeoutSeconds: 30,
acceptanceRequired: true,
backfillMode: "ALLOW",
gameSessionQueueArns: [
"arn:aws:gamelift:us-west-2:123456789012:gamesessionqueue/MyGameSessionQueue"
],
additionalPlayerCount: 1
});

Set up a matchmaking configuration with custom event data to track specific game events.

const customEventMatchmakingConfig = await AWS.GameLift.MatchmakingConfiguration("customEventMatchmakingConfig", {
name: "CustomEventMatchmaking",
ruleSetName: "customEventRuleSet",
requestTimeoutSeconds: 45,
acceptanceRequired: true,
customEventData: JSON.stringify({ eventID: "GameStart", playerCount: 10 }),
gameProperties: [
{
key: "Map",
value: "DesertMap"
}
]
});