AWS::GameLift::MatchmakingRuleSet - AWS CloudFormation


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.


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


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


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



A unique identifier for the 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


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


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.


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.


The Amazon Resource Name (ARN) for the script. For example: arn:aws:gamelift:us-west-2::matchmakingruleset/myrulesetname.


The unique name of the rule set.


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.


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


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