AWS CloudFormation
User Guide (Version )

AWS::GameLift::MatchmakingRuleSet

The AWS::GameLift::MatchmakingRuleSet resource creates a new rule set for FlexMatch matchmaking. A rule set describes the type of match to create, such as the number and size of teams. It also sets the parameters for acceptable player matches, such as minimum skill level or character type. A rule set is used by a matchmaking configuration.

Syntax

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

JSON

{ "Type" : "AWS::GameLift::MatchmakingRuleSet", "Properties" : { "Name" : String, "RuleSetBody" : String } }

YAML

Type: AWS::GameLift::MatchmakingRuleSet Properties: Name: String RuleSetBody: String

Properties

Name

A unique identifier for a matchmaking rule set. A matchmaking configuration identifies the rule set it uses by this name value. Note that the rule set name is different from the optional name field in the rule set body.

Required: Yes

Type: String

Maximum: 128

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

Update requires: Replacement

RuleSetBody

A collection of matchmaking rules, formatted as a JSON string. Comments are not allowed in JSON, but most elements support a description field.

Required: Yes

Type: String

Minimum: 1

Maximum: 65535

Update requires: Replacement

Return Values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the rule set name, which is unique within each Region.

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) assigned to the rule set.

Name

The unique name of the rule set.

Examples

Create a Matchmaking Rule Set

The following example creates a matchmaking rule set for GameLift FlexMatch named MyRuleSet. The simple rule set defines a match with one team containing 1 to 20 players. In the YAML example, since RuleSetBody must be in JSON format, the !Sub command is used to specify JSON content within the YAML format.

JSON

{ "Resources": { "MatchmakingRuleSet": { "Type": "AWS::GameLift::MatchmakingRuleSet", "Properties": { "Name": "MyRuleSet", "RuleSetBody": { "Fn::Sub": "{\"name\": \"MyMatchmakingRuleSet\",\"ruleLanguageVersion\": \"1.0\", \"teams\": [{\"name\": \"MyTeam\",\"minPlayers\": 1,\"maxPlayers\": 20}]}" } } } } }

YAML

Resources: MatchmakingRuleSet: Type: "AWS::GameLift::MatchmakingRuleSet" Properties: Name: "MyRuleSet" RuleSetBody: !Sub | { "name": "MyMatchmakingRuleSet", "ruleLanguageVersion": "1.0", "teams": [{ "name": "MyTeam", "minPlayers": 1, "maxPlayers": 20 }] }

See Also