AWS::GameLift::MatchmakingRuleSet - AWS CloudFormation

AWS::GameLift::MatchmakingRuleSet

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

Syntax

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

JSON

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

YAML

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

Properties

Name

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

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

Tags

A list of labels to assign to the new matchmaking rule set 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

Minimum: 1

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 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.

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").

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