Amazon GameLift
Developer Guide (Version )

Create a Matchmaking Rule Set

Create matchmaking rule sets for your FlexMatch matchmakers. Use either the Amazon GameLift console or the AWS Command Line Interface (CLI). For more detailed information on configuring a matchmaker, see Build a FlexMatch Rule Set.

Once created, matchmaking rule sets cannot be changed or deleted, so we recommend checking the rule set syntax before creating the rule set. Both the console and the AWS CLI provide a validation option.

Create a Matchmaking Rule Set (Console)

To create a rule set with the Amazon GameLift console:

  1. Open the Amazon GameLift console at https://console.aws.amazon.com/gamelift/.

  2. Switch to the region where you want to place your rule set. Rule sets must be defined in the same region as the matchmaking configuration they will be used with.

  3. From the Amazon GameLift main menu, choose Create matchmaking rule set and fill in the rule set details.

    • Rule set name – Create a meaningful name so you can easily identify it in a list and in events and metrics. The rule set name must be unique within a region. Matchmaking configurations identify which rule set to use by its name. Note: This is not the same as the "name" field in the rule set body, which is not currently used.

    • Rule set – Enter the JSON text of a rule set body. Create your own rule set body or copy from the FlexMatch Rule Set Examples page.

  4. Since rule sets can't be edited once they're created, it's a good idea to validate your rule set first. Click Validate rule set to verify that the syntax of your rule set body is correct.

  5. Once you've finished configuring a matchmaker, click Create rule set. If creation is successful, the rule set can be used by a matchmaker.

Create a Matchmaking Rule Set (AWS CLI)

To create a matchmaking rule set with the AWS CLI, open a command line window and use the create-matchmaking-rule-set command to define a new rule set. See complete documentation on this command in the AWS CLI Command Reference. If you haven't yet installed the AWS CLI, see Install the AWS CLI.

This example creates a simple matchmaking rule set that sets up a single team. Be sure to create the rule set in the same region as the matchmaking configurations that will reference 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}]}'

Copiable version:

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 you specified. The new rule set can now be used by a matchmaker.