awscc_gamelift_matchmaking_configuration (Resource)

The AWS::GameLift::MatchmakingConfiguration resource creates an Amazon GameLift (GameLift) matchmaking configuration.

Example Usage

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,
  ]

}

Schema

Required

Optional

Read-Only

Nested Schema for game_properties

Required:

Nested Schema for tags

Required:

Import

Import is supported using the following syntax:

$ terraform import awscc_gamelift_matchmaking_configuration.example <resource ID>