{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"codeGuideFiles":[],"metadata":{"markdoc":{"tagList":["partial"]},"type":"markdown"},"seo":{"title":"Catena - AWS FlexMatch - New Deployment","description":"Catena Tools - Your game backend tool kit. Built by game developers, for game developers to simplify your game's backend workflow."},"dynamicMarkdocComponents":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"catena---aws-flexmatch---new-deployment"},"children":["Catena - AWS FlexMatch - New Deployment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This document assumes you have not ran through ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/installation/aws-ec2"},"children":["AWS EC2 deplyoment steps"]},". You should have Catena deployed outside of AWS. We will step through as though there is currently no resources deployed in AWS."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If do have Catena deployed to AWS please refer too ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/features/matchmaking/aws-flex-match-existing-deployment"},"children":["Exisitng Deployment steps"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["AWS FlexMatch is responsible for grouping players together to form games or matches. Catena's integration into FlexMatch currently supports FlexMatch's \"standalone\" configuration, meaning that it only supports making matches and does not support provisioning game servers via AWS GameLift."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you would like to learn more about how Catena handles dedicated game servers, refer to the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/features/game-servers"},"children":["Match Broker"]}," documentation."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"engine-integration"},"children":["Engine Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This page is dedicated to explaining key concepts for matchmaking in Catena, utilizing ","AWS FlexMatch",". If you are interested in how to integrate matchmaking within a particular game engine, refer to your engine's documentation."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/engines/unity/matchmaking"},"children":["Unity - Matchmaking"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-is-aws-flexmatch"},"children":["What is AWS FlexMatch?"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-intro.html"},"children":["AWS FlexMatch"]},", also known as \"Amazon GameLift Servers FlexMatch\" is Amazon's offering for matchmaking players."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"getting-started"},"children":["Getting Started"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"1.-obtain-catena-source-code"},"children":["1. Obtain Catena source code"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Catena is distributed via Git. ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://git-scm.com/book/en/v2/Getting-Started-Installing-Git"},"children":["Instructions for installing Git can be found here"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To gain access to the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://github.com/CatenaTools/catena-tools-core"},"children":["Catena Source"]},", please contact us to obtain a license. Once you have access, clone Catena to your machine."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"git clone git@github.com:CatenaTools/catena-tools-core.git\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To configure FlexMatch, you will also need to clone Catena's Infrastructure as Code repository."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"git clone git@github.com:CatenaTools/infrastructure.git\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"2.-preparations"},"children":["2. Preparations"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"2a.-create-an-aws-account"},"children":["2a. Create an AWS Account"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Since this is your first deployment, you will need to setup an AWS account"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To create an AWS account, follow ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://aws.amazon.com/resources/create-account/"},"children":["these instructions from AWS"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"2b.-setup-deployment-iam-user-and-policy"},"children":["2b. Setup Deployment IAM User and Policy"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We need to setup user roles and permissions for using FlexMatch."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Right now we will setup the deployment user that allows us to provision our resources."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Log into the account you created in the previous step"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IAM"]}," -> ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IAM Policies"]}," and select ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Create Policy"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Switch to edit with Json editor and paste the following permissions. This is the deployment policy which will allow us to provision FlexMatches resources via terraform"]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"CloudControlApiForGameLiftResources\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"cloudformation:GetResource\",\n        \"cloudformation:CreateResource\",\n        \"cloudformation:UpdateResource\",\n        \"cloudformation:DeleteResource\",\n        \"cloudformation:ListResources\",\n        \"cloudformation:GetResourceRequestStatus\",\n        \"cloudformation:ListResourceRequests\"\n      ],\n      \"Resource\": \"*\"\n    },\n    {\n      \"Sid\": \"ManageCatenaSnsNotificationTopic\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"sns:CreateTopic\", \n        \"sns:DeleteTopic\", \n        \"sns:GetTopicAttributes\", \n        \"sns:SetTopicAttributes\", \n        \"sns:TagResource\", \n        \"sns:ListTagsForResource\", \n        \"sns:Subscribe\", \n        \"sns:Unsubscribe\", \n        \"sns:GetSubscriptionAttributes\"\n        ],\n      \"Resource\": \"arn:aws:sns:*:*:*\"\n    },\n    {\n      \"Sid\": \"ManageCatenaSqsNotificationQueue\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"sqs:CreateQueue\", \n        \"sqs:DeleteQueue\", \n        \"sqs:GetQueueAttributes\", \n        \"sqs:SetQueueAttributes\", \n        \"sqs:TagQueue\", \n        \"sqs:ListQueueTags\", \n        \"sqs:GetQueueUrl\", \n        \"sqs:AddPermission\"\n      ],\n      \"Resource\": \"arn:aws:sqs:*:*:*\"\n    },\n    {\n      \"Sid\": \"ManageCatenaGameLiftMatchmakingRuleSets\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"gamelift:CreateMatchmakingRuleSet\", \n        \"gamelift:DeleteMatchmakingRuleSet\", \n        \"gamelift:DescribeMatchmakingRuleSets\", \n        \"gamelift:TagResource\", \n        \"gamelift:ListTagsForResource\"\n        ],\n      \"Resource\": \"*\"\n    },\n    {\n      \"Sid\": \"ManageCatenaGameLiftMatchmakingConfigurations\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"gamelift:CreateMatchmakingConfiguration\", \n        \"gamelift:UpdateMatchmakingConfiguration\", \n        \"gamelift:DeleteMatchmakingConfiguration\", \n        \"gamelift:DescribeMatchmakingConfigurations\"\n      ],\n      \"Resource\": \"*\"\n    },\n    {\n      \"Sid\": \"ManageCatenaFlexMatchRuntimePolicy\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"iam:CreatePolicy\", \n        \"iam:DeletePolicy\", \n        \"iam:GetPolicy\",\n        \"iam:GetPolicyVersion\", \n        \"iam:ListPolicyVersions\",\n        \"iam:CreatePolicyVersion\", \n        \"iam:DeletePolicyVersion\",\n        \"iam:TagPolicy\", \n        \"iam:ListEntitiesForPolicy\"\n      ],\n      \"Resource\": \"arn:aws:iam::<ACCOUNT_ID>:policy/*catena-flexmatch-runtime-policy\"\n    },\n    {\n      \"Sid\": \"ManageCatenaFlexMatchRuntimeUser\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"iam:CreateUser\", \n        \"iam:DeleteUser\", \n        \"iam:GetUser\", \n        \"iam:TagUser\",\n        \"iam:AttachUserPolicy\", \n        \"iam:DetachUserPolicy\", \n        \"iam:ListAttachedUserPolicies\",\n        \"iam:ListUserPolicies\", \n        \"iam:ListGroupsForUser\", \n        \"iam:ListUserTags\"\n      ],\n      \"Resource\": \"arn:aws:iam::<ACCOUNT_ID>:user/*catena-flexmatch-runtime\"\n    }\n  ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This policy is setup to help deploy FlexMatch to AWS. These SIDs allow us to provision FlexMatch resources. We are using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CatenaDeploymentPolicy"]}," for Deploy time permissions."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Here is the breakdown of the deployment SIDs:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"SID"},"children":["SID"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Purpose"},"children":["Purpose"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ManageCatenaSnsNotificationTopic"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create and configure the SNS topic FlexMatch uses to publish matchmaking events"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ManageCatenaSqsNotificationQueue"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create and configure the SQS queue subscribed to that topic, which Catena polls for matchmaking updates"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ManageCatenaGameLiftMatchmakingRuleSets"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create/manage the GameLift rule sets defining team structure and match sizing"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ManageCatenaGameLiftMatchmakingConfigurations"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create/manage the GameLift matchmaking configurations that expose matchmaking to players"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ManageCatenaFlexMatchRuntimePolicy"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create, read, version, tag, and delete the FlexMatch runtime IAM policy"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CloudControlApiForGameLiftResources"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create, read, update, delete, and poll the status of resources managed through AWS Cloud Control API. Terraforms awscc provider routes all operations through Cloud Control."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ManageCatenaFlexMatchRuntimeUser"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create, read, tag, delete, and manage policy attachments for the FlexMatch runtime IAM user. Deployments outside of ec2 have no instance role so this allows terraform to create one."]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Name the policy ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CatenaDeploymentPolicy"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Got to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IAM Users"]}," and create a new user called ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["catena_deployment"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select Attach Policy, search for the newly created ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CatenaDeploymentPolicy"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Generate an access key under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Security Credentials"]}," -> ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Access Keys"]}," -> ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Create Access Key"]}," -> ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Third Party Service"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Make note of your Access Key and Secret Access Key. We will use these in the next step to configure our ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["catena_deploy"]}," cli profile for deployment."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"2c.-install-dependencies"},"children":["2c. Install Dependencies"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"aws-cli"},"children":["AWS CLI"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The AWS CLI is a tool that allows users to manage AWS resources through the command line. With it, you can expose credentials to Terraform in future steps."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["To install the AWS CLI, refer to ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html"},"children":["their installation documentation"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Once the CLI is installed, add your credentials that you created earlier. We'll be adding them to a specific profile called \"","catena_deploy","\", but you can use whatever profile name you'd like.",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For a list of available regions you can provide when prompted for the default region, refer to ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions"},"children":["available regions"]},". We recommend using the same region your S3 bucket was created in."]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"aws configure --profile catena_deploy\n\n# Interactive Input\n# AWS Access Key ID [None]: <YOUR_ACCESS_KEY>\n# AWS Secret Access Key [None]: <YOUR_SECRET_ACCESS_KEY>\n# Default region name [None]: <YOUR_DEFAULT_REGION> (i.e. 'us-east-1', 'us-east-2', 'us-west-1', 'eu-west-1`, etc.)\n# Default output format [None]: json\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Note: This is going to store the credentials on your local machine in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["~/.aws/credentials"]}," on Linux or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["%USERPROFILE%\\.aws\\credentials"]}," on Windows."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We recommend periodically rotating this credential to practice good security hygiene."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To do so, generate a new ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AccessKey"]}," in ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://us-east-1.console.aws.amazon.com/iam/home?region=us-east-1#/users"},"children":["AWS IAM User Console"]}," for the IAM user. Then again re-run:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"aws configure --profile catena_deploy\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Fill in the new ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AccessKey"]},"/",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SecretKey"]}," values when prompted. Be sure to deactivate the old ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AccessKey"]}," in the AWS IAM User Console after rotation."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"3.-configure-flexmatch"},"children":["3. Configure FlexMatch"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Now that you have everything prepped, it's time to configure FlexMatch in your AWS account. We will be using Terraform to configure the various components necessary for FlexMatch to operate. These include:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Matchmaking Ruleset(s)"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rulesets.html"},"children":["FlexMatch Rulesets"]}," define your game's team structure, size, and how to group players together for the best possible match."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Matchmaking Configuration(s)"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-create-configuration.html"},"children":["FlexMatch Configurations"]}," expose matchmaking functionality to the outside world. These are how Catena makes matchmaking requests to AWS."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Simple Notification Service (SNS) Topic"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://aws.amazon.com/sns/"},"children":["AWS SNS"]}," gives FlexMatch a place to post matchmaking events as they occur (i.e. match created)."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Simple Queue Service (SQS) Queue"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://aws.amazon.com/sqs/"},"children":["AWS SQS"]}," gives applications a way to subscribe to events that are sent to SNS topics. This is how Catena listens for matchmaking events for specific matchmaking tickets."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"3a.-provision-resources"},"children":["3a. Provision Resources"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to the Catena Infrastructure repository you cloned earlier."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["aws/flex-match/"]}," directory"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Initialize Terraform"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"terraform init\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you would like to customize the matchmaking queues that are available, edit the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["matchmaking_queues"]}," variable in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["variables.tf"]},". For every queue name, you will need to define a corresponding ruleset in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rule_sets/"]}," directory. For more information on rule sets, refer to the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rulesets.html"},"children":["match rulesets"]}," documentation from Amazon."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["(Optional) Run a Terraform plan. This will preview all of the AWS resources that are about to be provisioned."]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"terraform plan\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":6},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Run a Terraform apply. This will preview all of the AWS resource that are about to be provisioned, and prompt you if you'd like to proceed."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"terraform apply\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You should see a long list of output, with something resembling the following code block at the end."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Note: This is just example output."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"Apply complete! Resources: 6 added, 0 changed, 0 destroyed.\n\nOutputs:\n\nsqs_queue_url = \"https://sqs.us-east-1.amazonaws.com/000000000000/matchmaking-events\"\nflexmatch_runtime_user_name = \"my_workspace_catena_flexmatch_runtime_policy\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":7},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Keep note of the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sqs_queue_url"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["flexmatch_runtime_user_name"]}," that it outputs, as these will be used to configure your running instance of Catena."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You should now have FlexMatch resources deployed. This also created a runtime IAM user and Policy for FlexMatch. This policy will allow us to go through the matchmaking process. Here is a breakdown of the SIDs we defined:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"SID"},"children":["SID"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Purpose"},"children":["Purpose"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CatenaRuntimeGameLiftMatchmaking"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Lets running Catena application start, stop, and check matchmaking status via GameLift"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CatenaRuntimeSqsNotifications"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Lets the running application read and acknowledge matchmaking event messages from the FlexMatch notification queue"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"3b.-setup-runtime-credentials"},"children":["3b. Setup runtime credentials"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Now that we have our runtime user, we have to setup our Catena instance to actually use the user"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Log into your AWS account"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IAM"]}," -> ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IAM Users"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Find and select the user from the previous output at ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["flexmatch_runtime_user_name"]},", that was the generated user"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Generate an access key under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Security Credentials"]}," -> ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Access Keys"]}," -> ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Create Access Key"]}," -> ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Third Party Service"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Make note of your Access Key and Secret Access Key. We will use these to configure a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["catena_runtime"]}," cli profile for making matchmaking requests."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On the machine you have Catena running on, you will need to install the AWS Cli as we did earlier"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The AWS CLI is a tool that allows users to manage AWS resources through the command line. With it, you can expose credentials to Terraform in future steps."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["To install the AWS CLI, refer to ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html"},"children":["their installation documentation"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Once the CLI is installed, add your credentials that you created earlier. We'll be adding them to a specific profile called \"","catena_runtime","\", but you can use whatever profile name you'd like.",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For a list of available regions you can provide when prompted for the default region, refer to ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions"},"children":["available regions"]},". We recommend using the same region your S3 bucket was created in."]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"aws configure --profile catena_runtime\n\n# Interactive Input\n# AWS Access Key ID [None]: <YOUR_ACCESS_KEY>\n# AWS Secret Access Key [None]: <YOUR_SECRET_ACCESS_KEY>\n# Default region name [None]: <YOUR_DEFAULT_REGION> (i.e. 'us-east-1', 'us-east-2', 'us-west-1', 'eu-west-1`, etc.)\n# Default output format [None]: json\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Note: This is going to store the credentials on your local machine in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["~/.aws/credentials"]}," on Linux or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["%USERPROFILE%\\.aws\\credentials"]}," on Windows."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We recommend periodically rotating this credential to practice good security hygiene."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To do so, generate a new ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AccessKey"]}," in ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://us-east-1.console.aws.amazon.com/iam/home?region=us-east-1#/users"},"children":["AWS IAM User Console"]}," for the IAM user. Then again re-run:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"aws configure --profile catena_runtime\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Fill in the new ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AccessKey"]},"/",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SecretKey"]}," values when prompted. Be sure to deactivate the old ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AccessKey"]}," in the AWS IAM User Console after rotation."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once finished, your catena instance should now be authenticated to make matchmaking requests."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"3b.-configure-catena"},"children":["3b. Configure Catena"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once you have your resources provisioned, you can configure Catena. Catena is configured using appsettings files in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["catena-tools-core"]},". You will need the following items for Catena to work with FlexMatch:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"Catena\": {\n        ...\n        \"Matchmaker\": {\n            \"FlexMatch\": {\n                \"SQSQueueUrl\": \"<your_sqs_url_from_terraform_output>\",\n                \"GameLiftConfig\": {\n                    \"Profile\": \"<your_aws_profile_from_aws_cli>\",\n                    \"Region\": \"<your_aws_region_from_aws_cli>\"\n                }\n            }\n        }\n        ...\n    },\n    \"PreferredImplementations\": {\n        ...\n        \"ICatenaMatchmaker\": \"!AwsFlexMatch\"\n        ...\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Alternatively, you can expose your access key/secret key directly, though you ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["should not"]}," check these values into source control."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"Catena\": {\n        ...\n        \"Matchmaker\": {\n            \"FlexMatch\": {\n                \"SQSQueueUrl\": \"<your_sqs_url_from_terraform_output>\",\n                \"GameLiftConfig\": {\n                    \"AccessKey\": \"<your_aws_access_key>\",\n                    \"SecretKey\": \"<your_aws_secret_key>\",\n                    \"Region\": \"<your_aws_region_from_aws_cli>\"\n                }\n            }\n        }\n        ...\n    },\n    \"PreferredImplementations\": {\n        ...\n        \"ICatenaMatchmaker\": \"!AwsFlexMatch\"\n        ...\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-next"},"children":["What Next?"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Now that you have your matchmaker configured, it's time to integrate the matchmaker with your game engine."]},{"$$mdtype":"Tag","name":"Cards","attributes":{"columns":1,"cardMinWidth":240},"children":[{"$$mdtype":"Tag","name":"Card","attributes":{"title":"Unity Matchmaking","imagePosition":"start","iconPosition":"auto","layout":"vertical","align":"start","variant":"filled","to":"/engines/unity/matchmaking"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Integrate the Catena Matchmaker into your Unity Game"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Alternatively, if you are interested in matchmaking players into dedicated game servers, proceed to the game server documentation."]},{"$$mdtype":"Tag","name":"Cards","attributes":{"columns":1,"cardMinWidth":240},"children":[{"$$mdtype":"Tag","name":"Card","attributes":{"title":"Game Servers","imagePosition":"start","iconPosition":"auto","layout":"vertical","align":"start","variant":"filled","to":"/features/game-servers"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure dedicated game servers with Catena"]}]}]}]},"headings":[{"value":"Catena - AWS FlexMatch - New Deployment","id":"catena---aws-flexmatch---new-deployment","depth":1},{"value":"Engine Integration","id":"engine-integration","depth":2},{"value":"What is AWS FlexMatch?","id":"what-is-aws-flexmatch","depth":2},{"value":"Getting Started","id":"getting-started","depth":2},{"value":"1. Obtain Catena source code","id":"1.-obtain-catena-source-code","depth":3},{"value":"2. Preparations","id":"2.-preparations","depth":3},{"value":"2a. Create an AWS Account","id":"2a.-create-an-aws-account","depth":4},{"value":"2b. Setup Deployment IAM User and Policy","id":"2b.-setup-deployment-iam-user-and-policy","depth":4},{"value":"2c. Install Dependencies","id":"2c.-install-dependencies","depth":4},{"value":"AWS CLI","id":"aws-cli","depth":5},{"value":"3. Configure FlexMatch","id":"3.-configure-flexmatch","depth":3},{"value":"3a. Provision Resources","id":"3a.-provision-resources","depth":4},{"value":"3b. Setup runtime credentials","id":"3b.-setup-runtime-credentials","depth":4},{"value":"3b. Configure Catena","id":"3b.-configure-catena","depth":4},{"value":"What Next?","id":"what-next","depth":2}],"frontmatter":{"markdown":{"toc":{"depth":4}},"seo":{"title":"Catena - AWS FlexMatch - New Deployment"}},"lastModified":"2026-07-06T15:55:49.000Z"},"slug":"/features/matchmaking/aws-flex-match-new-deployment","userData":{"isAuthenticated":false,"teams":["anonymous"]}}