AWS::GameLift::MatchmakingConfiguration - AWS CloudFormation

AWS::GameLift::MatchmakingConfiguration

The AWS::GameLift::MatchmakingConfiguration resource defines a new matchmaking configuration for use with FlexMatch. Whether you're using FlexMatch with GameLift hosting or as a standalone matchmaking service, the matchmaking configuration sets out rules for matching players and forming teams. If you're using GameLift hosting, it also defines how to start game sessions for each match. Your matchmaking system can use multiple configurations to handle different game scenarios. All matchmaking requests identify the matchmaking configuration to use and provide player attributes that are consistent with that 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, "CreationTime" : String, "CustomEventData" : String, "Description" : String, "FlexMatchMode" : String, "GameProperties" : [ GameProperty, ... ], "GameSessionData" : String, "GameSessionQueueArns" : [ String, ... ], "Name" : String, "NotificationTarget" : String, "RequestTimeoutSeconds" : Integer, "RuleSetArn" : String, "RuleSetName" : String, "Tags" : [ Tag, ... ] } }

YAML

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

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. With this option enabled, matchmaking tickets use the status REQUIRES_ACCEPTANCE to indicate when a completed potential match is waiting for player acceptance.

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 acceptance is required.

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, if the configuration's rule set specifies a match for a single 12-person team, and the additional player count is set to 2, only 10 players are selected for the match. This parameter is not used if FlexMatchMode is set to STANDALONE.

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. Automatic backfill is not available when FlexMatchMode is set to STANDALONE.

Required: No

Type: String

Allowed values: AUTOMATIC | MANUAL

Update requires: No interruption

CreationTime

A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

Required: No

Type: String

Update requires: No interruption

CustomEventData

Information to add to all events related to the matchmaking configuration.

Required: No

Type: String

Minimum: 0

Maximum: 256

Update requires: No interruption

Description

A description for the matchmaking configuration.

Required: No

Type: String

Minimum: 1

Maximum: 1024

Update requires: No interruption

FlexMatchMode

Indicates whether this matchmaking configuration is being used with Amazon GameLift hosting or as a standalone matchmaking solution.

  • STANDALONE - FlexMatch forms matches and returns match information, including players and team assignments, in a MatchmakingSucceeded event.

  • WITH_QUEUE - FlexMatch forms matches and uses the specified Amazon GameLift queue to start a game session for the match.

Required: No

Type: String

Allowed values: STANDALONE | WITH_QUEUE

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. This parameter is not used if FlexMatchMode is set to STANDALONE.

Required: No

Type: Array 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. This parameter is not used ifFlexMatchMode is set to STANDALONE.

Required: No

Type: String

Minimum: 1

Maximum: 4096

Update requires: No interruption

GameSessionQueueArns

The Amazon Resource Name (ARN) that is assigned to a Amazon GameLift game session queue resource and uniquely identifies it. ARNs are unique across all Regions. Format is arn:aws:gamelift:<region>::gamesessionqueue/<queue name>. Queues can be located in any Region. Queues are used to start new Amazon GameLift-hosted game sessions for matches that are created with this matchmaking configuration. If FlexMatchMode is set to STANDALONE, do not set this parameter.

Required: No

Type: Array of String

Minimum: 1

Maximum: 256

Update requires: No interruption

Name

A unique identifier for the matchmaking configuration. This name is used to identify the configuration associated with a matchmaking request or ticket.

Required: Yes

Type: String

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

Maximum: 128

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

Pattern: [a-zA-Z0-9:_/-]*(.fifo)?

Minimum: 0

Maximum: 300

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

RuleSetArn

The Amazon Resource Name (ARN) associated with the GameLift matchmaking rule set resource that this configuration uses.

Required: No

Type: String

Pattern: ^arn:.*:matchmakingruleset\/[a-zA-Z0-9-\.]*

Update requires: No interruption

RuleSetName

A unique identifier for the matchmaking rule set to use with this configuration. You can use either the rule set name or ARN value. A matchmaking configuration can only use rule sets that are defined in the same Region.

Required: Yes

Type: String

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

Maximum: 128

Update requires: No interruption

Tags

A list of labels to assign to the new matchmaking configuration resource. Tags are developer-defined key-value pairs. Tagging AWS resources are useful for resource management, access management and cost allocation. For more information, see Tagging AWS Resources in the AWS General Reference. Once the resource is created, you can use TagResource, UntagResource, and ListTagsForResource to add, remove, and view tags. The maximum tag limit may be lower than stated. See the AWS General Reference for actual tagging limits.

Required: No

Type: Array of Tag

Maximum: 200

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 for use with GameLift managed hosting

The following example creates a matchmaking configuration for a game that is being hosted on GameLift servers, identifying a game session queue and providing a set of game properties to be passed on to new game sessions. Player acceptance is required, with a 60-second timeout, and auto-backfill is enabled. The example 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 for a GameLift-hosted game", "FlexMatchMode": "WITH_QUEUE", "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 for a GameLift-hosted game" FlexMatchMode: "WITH_QUEUE" GameSessionData: "MyGameSessionData" GameProperties: - Key: "level" Value: "10" - Key: "gameMode" Value: "hard" GameSessionQueueArns: - !GetAtt QueueResource.Arn RequestTimeoutSeconds: 100 RuleSetName: !Ref MatchmakingRuleSetResource DependsOn: - QueueResource - MatchmakingRuleSetResource

Create a matchmaking configuration for a standalone FlexMatch system

The following example creates a matchmaking configuration for a game that is hosted on resources other than GameLift game servers. This includes games that are hosted on Amazon EC2 with GameLift FleetIQ. This configuration omits the game session queue, game properties and session data, and additional player count. Player acceptance is required, with a 60-second timeout. It uses a Ref intrinsic function to specify the rule set, which is also in the template.

JSON

{ "Resources": { "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, "BackfillMode": "MANUAL", "CustomEventData": "MyCustomEventData", "Description": "A basic standalone matchmaking configuration", "FlexMatchMode": "STANDALONE", "RequestTimeoutSeconds": 100, "RuleSetName": { "Ref": "MatchmakingRuleSetResource" } }, "DependsOn": [ "MatchmakingRuleSetResource" ] } } }

YAML

Resources: 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 BackfillMode: "MANUAL" CustomEventData: "MyCustomEventData" Description: "A basic standalone matchmaking configuration" FlexMatchMode: "STANDALONE" RequestTimeoutSeconds: 100 RuleSetName: !Ref MatchmakingRuleSetResource DependsOn: - MatchmakingRuleSetResource

See also