The AWS::GameLift::MatchmakingConfiguration resource creates an Amazon GameLift (GameLift) matchmaking configuration.
IMPORTANT: The following contains 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_configuration to create a GameLift FlexMatch Matchmaking Configuration:
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
}
]
}]
})
}
resource "awscc_gamelift_game_session_queue" "example" {
name = "ExampleQueue"
timeout_in_seconds = 600
destinations = [
{
destination_arn = "your-fleet-or-fleet-alias-arn" // ARN of your Fleet or Fleet Alias
},
]
}
resource "awscc_gamelift_matchmaking_configuration" "example" {
name = "ExampleRuleSet"
acceptance_required = false
request_timeout_seconds = 60
rule_set_name = awscc_gamelift_matchmaking_rule_set.example.id
flex_match_mode = "WITH_QUEUE" // valid values are "WITH_QUEUE" or "STANDALONE"
game_session_queue_arns = [
awscc_gamelift_game_session_queue.example.arn,
]
}
acceptance_required
(Boolean) A flag that indicates whether a match that was created with this configuration must be accepted by the matched playersname
(String) A unique identifier for the matchmaking configuration.request_timeout_seconds
(Number) The maximum duration, in seconds, that a matchmaking ticket can remain in process before timing out.rule_set_name
(String) A unique identifier for the matchmaking rule set to use with this configuration.acceptance_timeout_seconds
(Number) The length of time (in seconds) to wait for players to accept a proposed match, if acceptance is required.additional_player_count
(Number) The number of player slots in a match to keep open for future players.backfill_mode
(String) The method used to backfill game sessions created with this matchmaking configuration.creation_time
(String) A time stamp indicating when this data object was created.custom_event_data
(String) Information to attach to all events related to the matchmaking configuration.description
(String) A descriptive label that is associated with matchmaking configuration.flex_match_mode
(String) Indicates whether this matchmaking configuration is being used with Amazon GameLift hosting or as a standalone matchmaking solution.game_properties
(Attributes Set) A set of custom properties for a game session, formatted as key:value pairs. (see below for nested schema)game_session_data
(String) A set of custom game session properties, formatted as a single string value.game_session_queue_arns
(List of String) The Amazon Resource Name (ARN) that is assigned to a Amazon GameLift game session queue resource and uniquely identifies it.notification_target
(String) An SNS topic ARN that is set up to receive matchmaking notifications.rule_set_arn
(String) The Amazon Resource Name (ARN) associated with the GameLift matchmaking rule set resource that this configuration uses.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 configuration resource and uniquely identifies it.id
(String) Uniquely identifies the resource.game_properties
Required:
key
(String) The game property identifier.value
(String) The game property value.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 0 to 256 Unicode characters in length.Import is supported using the following syntax:
$ terraform import awscc_gamelift_matchmaking_configuration.example <resource ID>