Tutorial: Create a matchmaking rule set
Before you create a matchmaking rule set for your Amazon GameLift FlexMatch matchmaker, we recommend checking the rule set syntax. After you create a rule set using the Amazon GameLift console or the Amazon Command Line Interface (Amazon CLI), you can't change it.
Note that there is a service quota
Topics
- Console
-
Create a rule set
-
Open the Amazon GameLift console at https://console.amazonaws.cn/gamelift/
. -
Switch to the Amazon Region where you want to create your rule set. Define rule sets in the same Region as the matchmaking configuration that uses them.
-
In the navigation pane, choose FlexMatch, Matchmaking rule sets.
-
On the Matchmaking rule sets page, choose Create rule set.
-
On the Create matchmaking rule set page, do the following:
-
Under Rule set settings, for Name, enter a unique descriptive name that you can use to identify it in a list or in events and metrics tables.
-
For Rule set, enter your rule set in JSON. For information about designing a rule set, see Design a FlexMatch rule set. You can also use one of the example rule sets from FlexMatch rule set examples.
-
Choose Validate to verify that the syntax of your rule set is correct. You can't edit rule sets after they're created, so it's a good idea to validate them first.
-
(Optional) Under Tags, add tags to help you manage and track your Amazon resources.
-
-
Choose Create. If creation is successful, you can use the rule set with a matchmaker.
-
- Amazon CLI
-
Create a rule set
Open a command line window and use the command create-matchmaking-rule-set.
This example command creates a simple matchmaking rule set that sets up a single team. Be sure to create the rule set in the same Amazon Region as the matchmaking configurations that uses it.
aws gamelift create-matchmaking-rule-set \ --name "SampleRuleSet123" \ --rule-set-body '{"name": "aliens_vs_cowboys", "ruleLanguageVersion": "1.0", "teams": [{"name": "cowboys", "maxPlayers": 8, "minPlayers": 4}]}'
If the creation request is successful, Amazon GameLift returns a MatchmakingRuleSet object that includes the settings that you specified. A matchmaker can now use the new rule set.
- Console
-
Delete a rule set
-
Open the Amazon GameLift console at https://console.amazonaws.cn/gamelift/
. -
Switch to the Region that you created the rule set in.
-
In the navigation pane, choose FlexMatch, Matchmaking rule sets.
-
On the Matchmaking rule sets page, select the rule set that you want to delete, and then choose Delete.
-
In the Delete rule set dialog box, choose Delete to confirm deletion.
Note
If a matchmaking configuration is using the rule set, Amazon GameLift displays an error message (Can't delete rule set). If this occurs, change the matchmaking configuration to use a different rule set, then try again. To find out which matchmaking configurations are using a rule set, choose the name of a rule set to view its details page.
-
- Amazon CLI
-
Delete a rule set
Open a command line window and use the command delete-matchmaking-rule-set to delete a matchmaking rule set.
If a matchmaking configuration is using the rule set, Amazon GameLift returns an error message. If this occurs, change the matchmaking configuration to use a different rule set, then try again. To get a list of which matchmaking configurations are using a rule set, use the command describe-matchmaking-configurations and specify the rule set name.
This example command checks for the matchmaking rule set's usage and then deletes the rule set.
aws gamelift describe-matchmaking-rule-sets \ --rule-set-name "SampleRuleSet123" \ --limit 10 aws gamelift delete-matchmaking-rule-set \ --name "SampleRuleSet123"