- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateMatchmakingRuleSetCommand
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 using ValidateMatchmakingRuleSet before creating a new rule set.
Learn more
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { GameLiftClient, CreateMatchmakingRuleSetCommand } from "@aws-sdk/client-gamelift"; // ES Modules import
// const { GameLiftClient, CreateMatchmakingRuleSetCommand } = require("@aws-sdk/client-gamelift"); // CommonJS import
const client = new GameLiftClient(config);
const input = { // CreateMatchmakingRuleSetInput
Name: "STRING_VALUE", // required
RuleSetBody: "STRING_VALUE", // required
Tags: [ // TagList
{ // Tag
Key: "STRING_VALUE", // required
Value: "STRING_VALUE", // required
},
],
};
const command = new CreateMatchmakingRuleSetCommand(input);
const response = await client.send(command);
// { // CreateMatchmakingRuleSetOutput
// RuleSet: { // MatchmakingRuleSet
// RuleSetName: "STRING_VALUE",
// RuleSetArn: "STRING_VALUE",
// RuleSetBody: "STRING_VALUE", // required
// CreationTime: new Date("TIMESTAMP"),
// },
// };
CreateMatchmakingRuleSetCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Name Required | string | undefined | 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 |
RuleSetBody Required | string | undefined | A collection of matchmaking rules, formatted as a JSON string. Comments are not allowed in JSON, but most elements support a description field. |
Tags | Tag[] | undefined | A list of labels to assign to the new matchmaking rule set resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see Tagging Amazon Web Services Resources in the Amazon Web Services General Reference. |
CreateMatchmakingRuleSetCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
RuleSet Required | MatchmakingRuleSet | undefined | The newly created matchmaking rule set. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalServiceException | server | The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period. |
InvalidRequestException | client | One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying. |
LimitExceededException | client | The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying. |
TaggingFailedException | client | The requested tagging operation did not succeed. This may be due to invalid tag format or the maximum tag limit may have been exceeded. Resolve the issue before retrying. |
UnsupportedRegionException | client | The requested operation is not supported in the Region specified. |
GameLiftServiceException | Base exception class for all service exceptions from GameLift service. |