Skip to main content

Deploy a Matchmaking Sample App using AWS SAM

Last updated on

Overview

In this documentation, you will learn how to build, test and deploy an application using the AWS Serverless Application Model (AWS SAM). The serverless application used in this documentation is a matchmaking sample application. This documentation will teach you how to test your application locally before deploying to AWS.

Prerequisites

Tools and Configuration

Ensure you have the following tools and permissions before you begin:

Server SDK LanguageLink
GolangAccelByte Cloud Golang SDK
PythonAccelByte Cloud Python SDK

Environment Variables Setup

To fill out the environment variables, follow the steps below.

  • Ensure you have set up your Game Namespace or create a new one if you have not done so already.

  • In your Game Namespace, create an OAuth Client for your Game Client set as Confidential type.

    IMPORTANT

    Don't forget to save the Game Client ID and Game Client Secret somewhere safe. This will be used in the AWS Serverless Application Model Template.

    Once the client is created, give it the following permissions:

    Permission TagPermission
    NAMESPACE:{namespace}:SESSION[READ]
    NAMESPACE:{namespace}:DSM:SERVER[CREATE UPDATE]
    NAMESPACE:{namespace}:DSM:SESSION[CREATE READ UPDATE DELETE]
  • In your Game Namespace, create an IAM Client for your Game Client and set it as Confidential type.

    IMPORTANT

    Don't forget to save the IAM Client ID and IAM Client Secret somewhere safe. This will be used in the AWS Serverless Application Model (SAM) Template.

    Once your client is created, give it the following permissions:

    Permission TagPermission
    ROLE[READ]
    NOTE

    If you need more information on how to set up your Game Client and IAM Client, see AccelByte Cloud's Client documentation.

  • Dedicated Server Deployment (DSMC Deployment)

    Create a Dedicated Server Deployment and save the Deployment Name. This will be used later in DSMC_DEPLOYMENT variables in the AWS SAM Template.

    IMPORTANT

    When you are setting up your Dedicated Server in the Admin Portal, make sure to set the Buffer Count value to 0—in Accelbyte's Matchmaking, only one Dedicated Server is needed, and is spawned when a session is created.

    If you fail to set the Buffer Count to 0, you will receive a server already claimed error.

  • Create a Matchmaking Ruleset in the Admin Portal. Save the Game Mode name as it will be used in the GAME_MODE and SESSION_BROWSER_MODE variables in the AWS SAM Template.