AWS::GameLift::MatchmakingRuleSet - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


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.

To create a matchmaking rule set, provide unique rule set name and the rule set body in JSON format. Rule sets must be defined in the same Region as the matchmaking configuration they are used with.

Since matchmaking rule sets cannot be edited, it is a good idea to check the rule set syntax.

Learn more


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


{ "Type" : "AWS::GameLift::MatchmakingRuleSet", "Properties" : { "Name" : String, "RuleSetBody" : String, "Tags" : [ Tag, ... ] } }


Type: AWS::GameLift::MatchmakingRuleSet Properties: Name: String RuleSetBody: String Tags: - Tag



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

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

Maximum: 128

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


A list of labels to assign to the new matchmaking rule set resource. Tags are developer-defined key-value pairs. Tagging Amazon resources are useful for resource management, access management and cost allocation. For more information, see Tagging Amazon Resources in the Amazon 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 Amazon General Reference for actual tagging limits.

Required: No

Type: Array of Tag

Minimum: 1

Maximum: 200

Update requires: No interruption

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 unique Amazon Resource Name (ARN) assigned to the rule set.


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


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