AWS CloudFormation
User Guide (Version )

AWS::GameLift::MatchmakingConfiguration

The AWS::GameLift::MatchmakingConfiguration resource defines a new matchmaking configuration for use with FlexMatch. A matchmaking configuration sets out guidelines for matching players and starting game sessions for the match. You can set up multiple matchmaking configurations to handle the scenarios needed for your game. Requests for matchmaking specify which configuration to use and provides the player attribute values that are required for the configuration.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::GameLift::MatchmakingConfiguration", "Properties" : { "AcceptanceRequired" : Boolean, "AcceptanceTimeoutSeconds" : Integer, "AdditionalPlayerCount" : Integer, "BackfillMode" : String, "CustomEventData" : String, "Description" : String, "GameProperties" : [ GameProperty, ... ], "GameSessionData" : String, "GameSessionQueueArns" : [ String, ... ], "Name" : String, "NotificationTarget" : String, "RequestTimeoutSeconds" : Integer, "RuleSetName" : String } }

YAML

Type: AWS::GameLift::MatchmakingConfiguration Properties: AcceptanceRequired: Boolean AcceptanceTimeoutSeconds: Integer AdditionalPlayerCount: Integer BackfillMode: String CustomEventData: String Description: String GameProperties: - GameProperty GameSessionData: String GameSessionQueueArns: - String Name: String NotificationTarget: String RequestTimeoutSeconds: Integer RuleSetName: String

Properties

AcceptanceRequired

A flag that determines whether a match that was created with this configuration must be accepted by the matched players. To require acceptance, set to TRUE.

Required: Yes

Type: Boolean

Update requires: No interruption

AcceptanceTimeoutSeconds

The length of time (in seconds) to wait for players to accept a proposed match. If any player rejects the match or fails to accept before the timeout, the ticket continues to look for an acceptable match.

Required: No

Type: Integer

Minimum: 1

Maximum: 600

Update requires: No interruption

AdditionalPlayerCount

The number of player slots in a match to keep open for future players. For example, assume that the configuration's rule set specifies a match for a single 12-person team. If the additional player count is set to 2, only 10 players are initially selected for the match.

Required: No

Type: Integer

Minimum: 0

Update requires: No interruption

BackfillMode

The method used to backfill game sessions that are created with this matchmaking configuration. Specify MANUAL when your game manages backfill requests manually or does not use the match backfill feature. Specify AUTOMATIC to have GameLift create a StartMatchBackfill request whenever a game session has one or more open slots. Learn more about manual and automatic backfill in Backfill Existing Games with FlexMatch.

Required: No

Type: String

Allowed Values: AUTOMATIC | MANUAL

Update requires: No interruption

CustomEventData

Information that is attached to all events related to the matchmaking configuration.

Required: No

Type: String

Minimum: 0

Maximum: 256

Update requires: No interruption

Description

A descriptive label that is associated with matchmaking configuration.

Required: No

Type: String

Minimum: 1

Maximum: 1024

Update requires: No interruption

GameProperties

A set of custom properties for a game session, formatted as key-value pairs. These properties are passed to a game server process with a request to start a new game session. See Start a Game Session.

Required: No

Type: List of GameProperty

Maximum: 16

Update requires: No interruption

GameSessionData

A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session. See Start a Game Session.

Required: No

Type: String

Minimum: 1

Maximum: 4096

Update requires: No interruption

GameSessionQueueArns

An Amazon Resource Name (ARN) that is assigned to a game session queue and uniquely identifies it. The format is arn:aws:gamelift:<region>:<aws account>:gamesessionqueue/<queue name>. These queues are used when placing game sessions for matches that are created with this matchmaking configuration. Queues can be located in any Region.

Required: Yes

Type: List of String

Update requires: No interruption

Name

A unique identifier for a matchmaking configuration. Matchmaking requests use this name to identify which matchmaking configuration to use.

Required: Yes

Type: String

Maximum: 128

Pattern: [a-zA-Z0-9-\.]*

Update requires: Replacement

NotificationTarget

An SNS topic ARN that is set up to receive matchmaking notifications. See Setting up Notifications for Matchmaking for more information.

Required: No

Type: String

Minimum: 0

Maximum: 300

Pattern: [a-zA-Z0-9:_/-]*

Update requires: No interruption

RequestTimeoutSeconds

The maximum duration, in seconds, that a matchmaking ticket can remain in process before timing out. Requests that fail due to timing out can be resubmitted as needed.

Required: Yes

Type: Integer

Minimum: 1

Maximum: 43200

Update requires: No interruption

RuleSetName

A unique identifier for a matchmaking rule set to use with this configuration. A matchmaking configuration can only use rule sets that are defined in the same Region.

Required: Yes

Type: String

Maximum: 128

Pattern: [a-zA-Z0-9-\.]*

Update requires: No interruption

Return Values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the MatchmakingConfiguration name, which is unique.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Arn

The unique Amazon Resource Name (ARN) for the MatchmakingConfiguration.

Name

The MatchmakingConfiguration name, which is unique.

Examples

Create a Matchmaking Configuration with a Rule Set and a Game Session Queue

The following example creates a matchmaking configuration for a game. It also uses a Ref intrinsic function to specify the game session queue and rule set, which are also in the template.

JSON

{ "Resources": { "QueueResource": { "Type": "AWS::GameLift::GameSessionQueue", "Properties": { "Name": "MyGameSessionQueue" } }, "MatchmakingRuleSetResource": { "Type": "AWS::GameLift::MatchmakingRuleSet", "Properties": { "Name": "MyRuleSet", "RuleSetBody": { "Fn::Sub": "{\"name\": \"MyMatchmakingRuleSet\",\"ruleLanguageVersion\": \"1.0\", \"teams\": [{\"name\": \"MyTeam\",\"minPlayers\": 1,\"maxPlayers\": 20}]}" } } }, "MatchmakingConfigurationResource": { "Type": "AWS::GameLift::MatchmakingConfiguration", "Properties": { "Name": "MyMatchmakingConfiguration", "AcceptanceRequired": true, "AcceptanceTimeoutSeconds": 60, "AdditionalPlayerCount": 8, "BackfillMode": "AUTOMATIC", "CustomEventData": "MyCustomEventData", "Description": "A basic matchmaking configuration", "GameSessionData": "MyGameSessionData", "GameProperties": [ { "Key": "level", "Value": "10" }, { "Key": "gameMode", "Value": "hard" } ], "GameSessionQueueArns": [ { "Fn::GetAtt": [ "QueueResource", "Arn" ] } ], "RequestTimeoutSeconds": 100, "RuleSetName": { "Ref": "MatchmakingRuleSetResource" } }, "DependsOn": [ "QueueResource", "MatchmakingRuleSetResource" ] } } }

YAML

Resources: QueueResource: Type: "AWS::GameLift::GameSessionQueue" Properties: Name: "MyGameSessionQueue" MatchmakingRuleSetResource: Type: "AWS::GameLift::MatchmakingRuleSet" Properties: Name: "MyRuleSet" # Rule set body for a game of 20 players RuleSetBody: !Sub | { "name": "MyMatchmakingRuleSet", "ruleLanguageVersion": "1.0", "teams": [{ "name": "MyTeam", "minPlayers": 1, "maxPlayers": 20 }] } MatchmakingConfigurationResource: Type: "AWS::GameLift::MatchmakingConfiguration" Properties: Name: "MyMatchmakingConfiguration" AcceptanceRequired: true AcceptanceTimeoutSeconds: 60 AdditionalPlayerCount: 8 BackfillMode: "AUTOMATIC" CustomEventData: "MyCustomEventData" Description: "A basic matchmaking configuration" GameSessionData: "MyGameSessionData" GameProperties: - Key: "level" Value: "10" - Key: "gameMode" Value: "hard" GameSessionQueueArns: - !GetAtt QueueResource.Arn RequestTimeoutSeconds: 100 RuleSetName: !Ref MatchmakingRuleSetResource DependsOn: - QueueResource - MatchmakingRuleSetResource

See Also