The AWS::GameLift::MatchmakingRuleSet resource creates an Amazon GameLift (GameLift) matchmaking rule set.
IMPORTANT: This is an example FlexMatch rule set. Your actual rule set will need to be modified with context to your game, and the specific configuration you desire. For help designing an Amazon GameLift FlexMatch rule set, see this documentation.
To use awscc_gamelift_matchmaking_rule_set to create a GameLift FlexMatch Matchmaking Rule Set:
resource "awscc_gamelift_matchmaking_rule_set" "example" {
name = "ExampleRuleSet"
rule_set_body = jsonencode({
name = "ExampleRuleSet",
ruleLanguageVersion = "1.0",
playerAttributes = [
{
name = "skill",
type = "number",
default = 10
}
],
teams = [
{
name = "all",
minPlayers = 3,
maxPlayers = 5
}
],
rules = [
{
name = "FairTeamSkill",
description = "The average skill of players in each team is within 10 points from the average skill of players in the match",
type = "distance",
// get players for each team, and average separately to produce list of 3
measurements = ["avg(teams[*].players.attributes[skill])"],
// get players for each team, flatten into a single list, and average to produce overall average
referenceValue = "avg(flatten(teams[*].players.attributes[skill]))",
maxDistance = 10 // minDistance would achieve the opposite result
}
],
expansions = [{
target = "rules[FairTeamSkill].maxDistance",
steps = [
{
waitTimeSeconds = 20,
value = 100
},
{
waitTimeSeconds = 30,
value = 150
}
]
}]
})
}
name
(String) A unique identifier for the matchmaking rule set.rule_set_body
(String) A collection of matchmaking rules, formatted as a JSON string.tags
(Attributes Set) An array of key-value pairs to apply to this resource. (see below for nested schema)arn
(String) The Amazon Resource Name (ARN) that is assigned to a Amazon GameLift matchmaking rule set resource and uniquely identifies it.creation_time
(String) A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds.id
(String) Uniquely identifies the resource.tags
Required:
key
(String) The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length.value
(String) The value for the tag. You can specify a value that is 1 to 256 Unicode characters in length.Import is supported using the following syntax:
$ terraform import awscc_gamelift_matchmaking_rule_set.example <resource ID>