

# Getting started with Amazon GameLift Servers
<a name="getting-started-intro"></a>

Take advantage of these getting started resources to learn more about the Amazon GameLift Servers service and how you can start developing a custom hosting solution for your session-based multiplayer games.

## Before you start
<a name="getting-started-intro-prereq"></a>
+ Create an AWS account (or designate an existing one) to use with Amazon GameLift Servers.
+ Set up users with permissions for Amazon GameLift Servers and related AWS services.
+ Select an AWS Region to work in. For development, choose a Region that's close to your location. You can change Regions at any time.

[Set up an AWS user account](setting-up-aws-login.md)

## Choose your path
<a name="getting-started-intro-paths"></a>

### I want to explore Amazon GameLift Servers quickly
<a name="getting-started-intro-quick"></a>

Best for: learning, creating a proof of concept, rapid prototyping

Quick start options:
+ [Game server wrapper for Amazon GameLift Servers](https://github.com/amazon-gamelift/amazon-gamelift-servers-game-server-wrapper/) – See [Tutorial: Quick onboarding with the Amazon GameLift Servers wrapper](gamelift-wrapper-tutorial.md). This tool is the quickest and easiest way to get your game server hosted and running game sessions with Amazon GameLift Servers, with no changes to game code required. The game server wrapper offers basic game session management functionality and streamlined game server deployment. It's ideal for doing a hands-on evaluation of Amazon GameLift Servers using your own game project or a sample project. When you're ready to build a custom game hosting solution, switch to one of the custom development options with full integration with the server SDK for Amazon GameLift Servers. If your game doesn't need a custom hosting solution, you can continue to use the game server wrapper to deploy and host your game servers in production. 
+ [Amazon GameLift Servers plugin for Unreal Engine or Unity](getting-started-plugin.md) – The plugins give you GUI workflows and sample assets to guide you through the initial steps and deploy your game server with a basic hosting solution. Use the plugin to set up hosting with self-managed Anywhere fleets, or deploy cloud-based, managed EC2 fleets or container fleets. When you're ready to develop a custom hosting solution, you can build on your plugin-built solutions.
+ [Starter kit for Amazon GameLift Servers managed containers](https://github.com/aws/amazon-gamelift-toolkit/tree/main/containers-starter-kit) – This kit streamlines tasks to integrate a game server, prepare a game server container image, and deploy a container fleet for hosting. For integration, the kit adds essential game session management features to your game server. The kit uses pre-configured templates to build a container fleet and an automated deployment pipeline for the game server. When you're ready to add full game session management features, follow one of the custom development roadmaps to integrate the server SDK for Amazon GameLift Servers.

### I want to build a custom hosting solution
<a name="getting-started-intro-custom"></a>

Best for: creating a production-level solution for a custom game server 

Review the page [Amazon GameLift Servers game hosting options](gamelift-intro-flavors.md) and choose one of the options for your solution. Follow one of these development roadmaps to get started building a full-featured custom hosting solution for your game. The roadmaps provide detailed guidance on how to create, test, and customize each component in your hosting solution. 
+ [Development roadmap for hosting with Amazon GameLift Servers managed EC2](gamelift-roadmap-managed.md)
+ [Development roadmap for hosting with Amazon GameLift Servers managed containers](gamelift-roadmap-containers.md)
+ [Development roadmap for hosting with Amazon GameLift Servers Anywhere](gamelift-roadmap-anywhere.md)
+ [Development roadmap for hybrid hosting with Amazon GameLift Servers](gamelift-roadmap-hybrid.md)

## Recommended learning path
<a name="getting-started-intro-recommended"></a>

1. Start small. Try the game server wrapper or the plugin for Unreal. 

1. Understand the concepts. Review the page [How hosting with Amazon GameLift Servers works](gamelift-howitworks.md).

1. Choose architecture. Select your hosting model based on your game's requirements.

1. Build and test. Follow the appropriate development roadmap. Build a basic version of each component and then iterate and customize.

1. Scale and optimize. Optimize your solution for production-level usage. Add advanced features such as matchmaking.

# Set up an AWS user account
<a name="setting-up-aws-login"></a>

**Tip**  
Use these topics to get help with these tasks:   
Get a new AWS account for use with Amazon GameLift Servers.
Create a user or group with permissions to work with Amazon GameLift Servers resources.
Set up security credentials (you need these to use the AWS CLI tools and the Amazon GameLift Servers plugins for Unreal and Unity)


As with all AWS services, you need an AWS account to use the Amazon GameLift Servers service and tools. An AWS account serves two primary functions: (1) it gives you a container for all the AWS resources that you create with the account; and (2) it lets you manage security for your AWS resources, including setting up user authentication and controlling user access permissions. There's no cost for creating an AWS account. 

**Explore Amazon GameLift Servers with or without an AWS account**  
You **don't** need an AWS account to:
+ Discover AWS tools for building, running, and growing game experiences at [AWS for Games](https://aws.amazon.com/gametech/). Read the [Blog](https://aws.amazon.com/blogs/gametech/) and browse the [Solutions for Games library](https://aws.amazon.com/solutions/games).
+ Learn more about Amazon GameLift Servers in the [product overview, FAQs, and resources](https://aws.amazon.com/gamelift/). **Ask AWS** to find answers to your product questions. (Try this one: "Looking for low-cost options to host my multiplayer game".)
+ For a deeper dive, find out what makes Amazon GameLift Servers work in the [technical documentation](https://docs.aws.amazon.com/gamelift/), including developer guides for hosting and matchmaking, and the service API reference guide.
+ Check out information on [Amazon GameLift Servers pricing](https://aws.amazon.com/gamelift/servers/pricing/) and cost optimization techniques. Try the [Pricing Calculator](https://calculator.aws/#/createCalculator/GameLift) to see how hosting costs are calculated based on peak concurrent player usage (CCU).
+ Get downloads and see code repositories for Amazon GameLift Servers SDKs, plugins, and toolkits. See [Amazon GameLift Servers Getting started](https://aws.amazon.com/gamelift/servers/getting-started/). (You need an AWS account to use them.)

You **do** need an AWS account to: 
+ Follow onboarding workflows with the Amazon GameLift Servers plugins for Unreal and Unity, or use the game server wrapper.
+ Create and manage AWS resources using the AWS Management Console. 
+ Create and manage AWS resources using the AWS Command Line Interface.
+ Use Amazon Q with the In the Amazon GameLift Servers technical documentation to find answers, guidance, and recommendations. 

**Topics**
+ [Sign up for an AWS account](#sign-up-for-aws)
+ [Create a user with administrative access](#create-an-admin)
+ [Set user permissions for Amazon GameLift Servers](#getting-started-create-iam-user)
+ [Set up programmatic access for users](#getting-started-iam-user-access-keys)
+ [Set up programmatic access for your game](#getting-started-iam-player-user)
+ [IAM permission examples for Amazon GameLift Servers](gamelift-iam-policy-examples.md)
+ [Set up an IAM service role for Amazon GameLift Servers](setting-up-role.md)

## Sign up for an AWS account
<a name="sign-up-for-aws"></a>

If you do not have an AWS account, complete the following steps to create one.

**To sign up for an AWS account**

1. Open [https://portal.aws.amazon.com/billing/signup](https://portal.aws.amazon.com/billing/signup).

1. Follow the online instructions.

   Part of the sign-up procedure involves receiving a phone call or text message and entering a verification code on the phone keypad.

   When you sign up for an AWS account, an *AWS account root user* is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to a user, and use only the root user to perform [tasks that require root user access](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#root-user-tasks).

AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to [https://aws.amazon.com/](https://aws.amazon.com/) and choosing **My Account**.

## Create a user with administrative access
<a name="create-an-admin"></a>

After you sign up for an AWS account, secure your AWS account root user, enable AWS IAM Identity Center, and create an administrative user so that you don't use the root user for everyday tasks.

**Secure your AWS account root user**

1.  Sign in to the [AWS Management Console](https://console.aws.amazon.com/) as the account owner by choosing **Root user** and entering your AWS account email address. On the next page, enter your password.

   For help signing in by using root user, see [Signing in as the root user](https://docs.aws.amazon.com/signin/latest/userguide/console-sign-in-tutorials.html#introduction-to-root-user-sign-in-tutorial) in the *AWS Sign-In User Guide*.

1. Turn on multi-factor authentication (MFA) for your root user.

   For instructions, see [Enable a virtual MFA device for your AWS account root user (console)](https://docs.aws.amazon.com/IAM/latest/UserGuide/enable-virt-mfa-for-root.html) in the *IAM User Guide*.

**Create a user with administrative access**

1. Enable IAM Identity Center.

   For instructions, see [Enabling AWS IAM Identity Center](https://docs.aws.amazon.com//singlesignon/latest/userguide/get-set-up-for-idc.html) in the *AWS IAM Identity Center User Guide*.

1. In IAM Identity Center, grant administrative access to a user.

   For a tutorial about using the IAM Identity Center directory as your identity source, see [ Configure user access with the default IAM Identity Center directory](https://docs.aws.amazon.com//singlesignon/latest/userguide/quick-start-default-idc.html) in the *AWS IAM Identity Center User Guide*.

**Sign in as the user with administrative access**
+ To sign in with your IAM Identity Center user, use the sign-in URL that was sent to your email address when you created the IAM Identity Center user.

  For help signing in using an IAM Identity Center user, see [Signing in to the AWS access portal](https://docs.aws.amazon.com/signin/latest/userguide/iam-id-center-sign-in-tutorial.html) in the *AWS Sign-In User Guide*.

**Assign access to additional users**

1. In IAM Identity Center, create a permission set that follows the best practice of applying least-privilege permissions.

   For instructions, see [ Create a permission set](https://docs.aws.amazon.com//singlesignon/latest/userguide/get-started-create-a-permission-set.html) in the *AWS IAM Identity Center User Guide*.

1. Assign users to a group, and then assign single sign-on access to the group.

   For instructions, see [ Add groups](https://docs.aws.amazon.com//singlesignon/latest/userguide/addgroups.html) in the *AWS IAM Identity Center User Guide*.

## Set user permissions for Amazon GameLift Servers
<a name="getting-started-create-iam-user"></a>

Create additional users or extend access permissions to existing users as needed for your Amazon GameLift Servers resources. As a best practice ([ Security best practices in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)), apply least-privilege permissions for all users. For guidance on permissions syntax, see [IAM permission examples for Amazon GameLift Servers](gamelift-iam-policy-examples.md).

Use following instructions to set user permissions based on how you manage the users in your AWS account. 

To provide access, add permissions to your users, groups, or roles:
+ Users and groups in AWS IAM Identity Center:

  Create a permission set. Follow the instructions in [Create a permission set](https://docs.aws.amazon.com//singlesignon/latest/userguide/howtocreatepermissionset.html) in the *AWS IAM Identity Center User Guide*.
+ Users managed in IAM through an identity provider:

  Create a role for identity federation. Follow the instructions in [Create a role for a third-party identity provider (federation)](https://docs.aws.amazon.com//IAM/latest/UserGuide/id_roles_create_for-idp.html) in the *IAM User Guide*.
+ IAM users:
  + Create a role that your user can assume. Follow the instructions in [Create a role for an IAM user](https://docs.aws.amazon.com//IAM/latest/UserGuide/id_roles_create_for-user.html) in the *IAM User Guide*.
  + (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the instructions in [Adding permissions to a user (console)](https://docs.aws.amazon.com//IAM/latest/UserGuide/id_users_change-permissions.html#users_change_permissions-add-console) in the *IAM User Guide*.

When working with IAM users, as a best practice always attach permissions to roles or user groups, not individual users.

## Set up programmatic access for users
<a name="getting-started-iam-user-access-keys"></a>

Users need programmatic access if they want to interact with AWS outside of the AWS Management Console. The way to grant programmatic access depends on the type of user that's accessing AWS.

To grant users programmatic access, choose one of the following options.


****  

| Which user needs programmatic access? | To | By | 
| --- | --- | --- | 
| IAM | (Recommended) Use console credentials as temporary credentials to sign programmatic requests to the AWS CLI, AWS SDKs, or AWS APIs. |  Following the instructions for the interface that you want to use. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/gameliftservers/latest/developerguide/setting-up-aws-login.html)  | 
|  Workforce identity (Users managed in IAM Identity Center)  | Use temporary credentials to sign programmatic requests to the AWS CLI, AWS SDKs, or AWS APIs. |  Following the instructions for the interface that you want to use. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/gameliftservers/latest/developerguide/setting-up-aws-login.html)  | 
| IAM | Use temporary credentials to sign programmatic requests to the AWS CLI, AWS SDKs, or AWS APIs. | Following the instructions in [Using temporary credentials with AWS resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) in the IAM User Guide. | 
| IAM | (Not recommended)Use long-term credentials to sign programmatic requests to the AWS CLI, AWS SDKs, or AWS APIs. |  Following the instructions for the interface that you want to use. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/gameliftservers/latest/developerguide/setting-up-aws-login.html)  | 

If you use access keys, see [Best practices for managing AWS access keys](https://docs.aws.amazon.com/accounts/latest/reference/credentials-access-keys-best-practices.html).

## Set up programmatic access for your game
<a name="getting-started-iam-player-user"></a>

Most games use backend services to communicate with Amazon GameLift Servers using the AWS SDKs. Use a backend service (acting for a game client) to request game sessions, place players into games, and other tasks. These services need programmatic access and security credentials to authenticate calls to the service API for Amazon GameLift Servers. 

For Amazon GameLift Servers, you manage this access by creating a player user in AWS Identity and Access Management (IAM). Manage player user permissions through one of the following options:
+ Create an IAM role with player user permissions and allow the player user to assume the role when needed. The backend service must include code to assume this role before making requests to Amazon GameLift Servers. In accordance with security best practices, roles provide limited, temporary access. You can use roles for workloads running on AWS resources ([IAM roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)) or outside of AWS ([IAM Roles Anywhere](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_non-aws.html)).
+ Create an IAM user group with player user permissions and add your player user to the group. This option gives your player user long-term credentials, which the backend service must store and use when communicating with Amazon GameLift Servers.

For permissions policy syntax, see [Player user permission examples](gamelift-iam-policy-examples.md#iam-policy-admin-game-dev-example). 

For more information on managing permissions for use by a workload, see [IAM Identities: Temporary credentials in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/id.html#id_temp-creds).

# IAM permission examples for Amazon GameLift Servers
<a name="gamelift-iam-policy-examples"></a>

Use the syntax in these examples to set AWS Identity and Access Management (IAM) permissions for users that need access to Amazon GameLift Servers resources. For more information on managing user permissions, see [Set user permissions for Amazon GameLift Servers](setting-up-aws-login.md#getting-started-create-iam-user). When managing permissions for users outside of the IAM Identity Center, as a best practice always attach permissions to IAM roles or user groups, not individual users.

If you're using Amazon GameLift Servers FleetIQ as a standalone solution, see [Set up your AWS account for Amazon GameLift Servers FleetIQ](https://docs.aws.amazon.com/gameliftservers/latest/fleetiqguide/gsg-iam-permissions.html).

## Administration permission examples
<a name="iam-policy-simple-example"></a>

These examples give a hosting administrator or developer targeted access to manage Amazon GameLift Servers game hosting resources.

**Example Syntax for Amazon GameLift Servers full access resource permissions**  
The following example extends full access to all Amazon GameLift Servers resources.    
****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": {
    "Effect": "Allow",
    "Action": "gamelift:*",
    "Resource": "*"
  }
}
```

**Example Syntax for Amazon GameLift Servers resource permissions with support for Regions that aren't enabled by default**  
The following example extends access to all Amazon GameLift Servers resources and AWS Regions that aren't enabled by default. For more information about Regions that aren't enabled by default and how to enable them, see [Managing AWS Regions](https://docs.aws.amazon.com/general/latest/gr/rande-manage.html) in the *AWS General Reference*.    
****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": {
    "Effect": "Allow",
    "Action": [
      "ec2:DescribeRegions",
      "gamelift:*"
    ],
    "Resource": "*"
  }
}
```

**Example Syntax for Amazon GameLift Servers resource to access container images in Amazon ECR**  
The following example extends access to Amazon Elastic Container Registry (Amazon ECR) actions that Amazon GameLift Servers users need when working with managed container fleets.     
****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": {
    "Effect": "Allow",
    "Action": [
      "ecr:DescribeImages",
      "ecr:BatchGetImage",
      "ecr:GetDownloadUrlForLayer"
    ],
    "Resource": "*"
  }
}
```

**Example Syntax for Amazon GameLift Servers resource and `PassRole` permissions**  
The following example extends access to all Amazon GameLift Servers resources and allows a user to pass an IAM service role to Amazon GameLift Servers. A service role gives Amazon GameLift Servers limited ability to access other resources and services on your behalf, as is described in [Set up an IAM service role for Amazon GameLift Servers](setting-up-role.md). For example, when responding to a `CreateBuild` request, Amazon GameLift Servers needs access to your build files in an Amazon S3 bucket. For more information about the `PassRole` action, see [IAM: Pass an IAM role to a specific AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_iam-passrole-service.html) in the *IAM User Guide*.    
****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "gamelift:*",
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "iam:PassRole",
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "iam:PassedToService": "gamelift.amazonaws.com"
        }
      }
    }
  ]
}
```

## Player user permission examples
<a name="iam-policy-admin-game-dev-example"></a>

These examples allow a backend service or other entity to make API calls to the Amazon GameLift Servers API. They cover the common scenarios for managing game sessions, player sessions, and matchmaking. For more details, see [Set up programmatic access for your game](setting-up-aws-login.md#getting-started-iam-player-user).

**Example Syntax for game session placement permissions**  
The following example extends access to the Amazon GameLift Servers APIs that use game session placement queues to create game sessions and manage player sessions.     
****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": {
    "Sid": "PlayerPermissionsForGameSessionPlacements",
    "Effect": "Allow",
    "Action": [
      "gamelift:StartGameSessionPlacement",
      "gamelift:DescribeGameSessionPlacement",
      "gamelift:StopGameSessionPlacement",
      "gamelift:CreatePlayerSession",
      "gamelift:CreatePlayerSessions",
      "gamelift:DescribeGameSessions"
    ],
    "Resource": "*"
  }
}
```

**Example Syntax for matchmaking permissions**  
The following example extends access to the Amazon GameLift Servers APIs that manage FlexMatch matchmaking activities. FlexMatch matches players for new or existing game sessions and initiates game session placement for games hosted on Amazon GameLift Servers. For more information about FlexMatch, see [What is Amazon GameLift Servers FlexMatch?](https://docs.aws.amazon.com/gameliftservers/latest/flexmatchguide/match-intro.html)    
****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": {
    "Sid": "PlayerPermissionsForGameSessionMatchmaking",
    "Effect": "Allow",
    "Action": [
      "gamelift:StartMatchmaking",
      "gamelift:DescribeMatchmaking",
      "gamelift:StopMatchmaking",
      "gamelift:AcceptMatch",
      "gamelift:StartMatchBackfill",
      "gamelift:DescribeGameSessions"
    ],
    "Resource": "*"
  }
}
```

**Example Syntax for manual game session placement permissions**  
The following example extends access to the Amazon GameLift Servers APIs that manually create game sessions and player sessions on specified fleets. This scenario supports games that don't use placement queues, such as games that let players join by choosing from a list of available game sessions (the "list-and-pick" method).    
****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": {
    "Sid": "PlayerPermissionsForManualGameSessions",
    "Effect": "Allow",
    "Action": [
      "gamelift:CreateGameSession",
      "gamelift:DescribeGameSessions",
      "gamelift:SearchGameSessions",
      "gamelift:CreatePlayerSession",
      "gamelift:CreatePlayerSessions",
      "gamelift:DescribePlayerSessions"
    ],
    "Resource": "*"
  }
}
```

# Set up an IAM service role for Amazon GameLift Servers
<a name="setting-up-role"></a>

Some Amazon GameLift Servers features require you to extend limited access to other AWS resources that you own. You can do this by creating an AWS Identity and Access Management (IAM) role. An [IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) is an IAM identity that you can create in your account that has specific permissions. An IAM role is similar to an IAM user in that it is an AWS identity with permissions policies that determine what the identity can and cannot do in AWS. However, instead of being uniquely associated with one person, a role is intended to be assumable by anyone who needs it. Also, a role does not have standard long-term credentials such as a password or access keys associated with it. Instead, when you assume a role, it provides you with temporary security credentials for your role session. 

This topic covers how to create a role that you can use with your Amazon GameLift Servers managed fleets. If you use Amazon GameLift Servers FleetIQ to optimize game hosting on your Amazon Elastic Compute Cloud (Amazon EC2) instances, see [ Set up your AWS account for Amazon GameLift Servers FleetIQ](https://docs.aws.amazon.com/gameliftservers/latest/fleetiqguide/gsg-iam-permissions.html).

In the following procedure, create a role with a custom permissions policy and a trust policy that allows Amazon GameLift Servers to assume the role.

## Create an IAM service role for an Amazon GameLift Servers managed EC2 fleet
<a name="setting-up-role-custom"></a>

**Step 1: Create a permissions policy.**

Use the instructions and examples on this page to create a custom permissions policy for the type of Amazon GameLift Servers fleet you're working with.

**To use the JSON policy editor to create a policy**

1. Sign in to the AWS Management Console and open the IAM console at [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/).

1. In the navigation pane on the left, choose **Policies**. 

   If this is your first time choosing **Policies**, the **Welcome to Managed Policies** page appears. Choose **Get Started**.

1. At the top of the page, choose **Create policy**.

1. In the **Policy editor** section, choose the **JSON** option.

1. Enter or paste a JSON policy document. For details about the IAM policy language, see [IAM JSON policy reference](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html).

1. Resolve any security warnings, errors, or general warnings generated during [policy validation](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_policy-validator.html), and then choose **Next**. 
**Note**  
You can switch between the **Visual** and **JSON** editor options anytime. However, if you make changes or choose **Next** in the **Visual** editor, IAM might restructure your policy to optimize it for the visual editor. For more information, see [Policy restructuring](https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_policies.html#troubleshoot_viseditor-restructure) in the *IAM User Guide*.

1. (Optional) When you create or edit a policy in the AWS Management Console, you can generate a JSON or YAML policy template that you can use in CloudFormation templates.

   To do this, in the **Policy editor** choose **Actions**, and then choose **Generate CloudFormation template**. To learn more about CloudFormation, see [AWS Identity and Access Management resource type reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_IAM.html) in the *AWS CloudFormation User Guide*.

1. When you are finished adding permissions to the policy, choose **Next**.

1. On the **Review and create** page, enter a **Policy name** and a **Description** (optional) for the policy that you are creating. Review **Permissions defined in this policy** to see the permissions that are granted by your policy.

1. (Optional) Add metadata to the policy by attaching tags as key-value pairs. For more information about using tags in IAM, see [Tags for AWS Identity and Access Management resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html) in the *IAM User Guide*.

1. Choose **Create policy** to save your new policy.

**Step 2: Create a role that Amazon GameLift Servers can assume.**

**To create an IAM role**

1. In the navigation pane of the IAM console, choose **Roles**, and then choose **Create role**.

1. On the **Select trusted entity** page, choose the **Custom trust policy** option. This selection opens the **Custom trust policy** editor.

1. Replace the default JSON syntax with the following, and then choose **Next** to continue.

------
#### [ JSON ]

****  

   ```
   {
     "Version":"2012-10-17",		 	 	 
     "Statement": [
       {
         "Effect": "Allow",
         "Principal": {
           "Service": "gamelift.amazonaws.com"
         },
         "Action": "sts:AssumeRole"
       }
     ]
   }
   ```

------

1. On the **Add permissions** page, locate and select the permissions policy that you created in Step 1. Choose **Next** to continue.

1. On the **Name, review and create** page, enter a **Role name** and a **Description** (optional) for the role that you are creating. Review the **Trust entities** and **Added permissions**.

1. Choose **Create role** to save your new role.

## Create an IAM role for Amazon GameLift Servers managed containers
<a name="setting-up-role-containers"></a>

If you're using Amazon GameLift Servers managed containers, you need to create an IAM service role for use with a container fleet. This role grants limited permissions that Amazon GameLift Servers needs to manage your container fleet resources and take actions on your behalf.

**To create an IAM role for a container fleet**

1. Sign in to the AWS Management Console and open the IAM console at [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/).

1. In the navigation pane of the IAM console, choose **Roles**, and then choose **Create role**.

1. On **Select trusted entity** page, choose **AWS service** and select the **Use case** "GameLift". Choose **Next**

1. On **Add permissions**, choose the managed policy `GameLiftContainerFleetPolicy`. Choose **Next**. See [AWS managed policies for Amazon GameLift Servers](security-iam-awsmanpol.md)for more information about this policy.

1. On **Name, review, and create**, enter a role name and choose **Create role** to save the new role.

## Permission policy syntax
<a name="setting-up-role-syntax"></a>
+ **Permissions for Amazon GameLift Servers to assume the service role**

------
#### [ JSON ]

****  

  ```
  {
    "Version":"2012-10-17",		 	 	 
    "Statement": [
      {
        "Effect": "Allow",
        "Principal": {
          "Service": "gamelift.amazonaws.com"
        },
        "Action": "sts:AssumeRole"
      }
    ]
  }
  ```

------
+ **Permissions to access AWS Regions that aren't enabled by default**

------
#### [ JSON ]

****  

  ```
  {
    "Version":"2012-10-17",		 	 	 
    "Statement": [
      {
        "Effect": "Allow",
        "Principal": {
          "Service": [
            "gamelift.amazonaws.com",
            "gamelift.ap-east-1.amazonaws.com",
            "gamelift.me-south-1.amazonaws.com",
            "gamelift.af-south-1.amazonaws.com",
            "gamelift.eu-south-1.amazonaws.com" 
          ]
        },
        "Action": "sts:AssumeRole"
      }
    ]
  }
  ```

------

# Get Amazon GameLift Servers development tools
<a name="gamelift-supported"></a>

Amazon GameLift Servers provides a set of SDKs and other tools to help you build game hosting solutions for your games. The SDKs add functionality to game servers, game clients, and backend services that enables them to interact with the Amazon GameLift Servers service. For the latest information about Amazon GameLift Servers SDK versions and compatibility, see [Amazon GameLift Servers release notes](release-notes.md).

## For game servers
<a name="gamelift-supported-servers"></a>

Integrate and build your 64-bit game servers with the server SDK for Amazon GameLift Servers. The game server uses the server SDK to communicate with the Amazon GameLift Servers service for game session management, including starting, updating, and stopping game sessions. For help with integrating the server SDK into your game projects, see [Prepare a game for hosting with Amazon GameLift Servers](integration-intro.md).

### Development support
<a name="gamelift-supported-servers-dev"></a>
+ **Development OS**
  + Windows
  + Linux
+ **Programming languages** 

  **[Get the Amazon GameLift Servers SDK](https://github.com/amazon-gamelift).** For version-specific information and install instructions, see the included readme files in each package.
  + [C\$1\$1 server SDK](https://github.com/amazon-gamelift/amazon-gamelift-servers-cpp-server-sdk)
    + [Server SDK reference](integration-server-sdk5-cpp-actions.md)
    + [How to integrate](gamelift-sdk-server-api.md)
  + [C\$1 server SDK](https://github.com/amazon-gamelift/amazon-gamelift-servers-csharp-server-sdk) (Support for .NET 4, .NET 6, .NET 8 varies by version, see [SDK versions](release-notes.md#release-notes-history))
    + [Server SDK reference](integration-server-sdk5-csharp-actions.md)
    + [How to integrate](gamelift-sdk-server-api.md)
  + [Go server SDK](https://github.com/amazon-gamelift/amazon-gamelift-servers-go-server-sdk)
    + [Server SDK reference](integration-server-sdk-go-actions.md)
    + [How to integrate](gamelift-sdk-server-api.md)
+ **Game engine support**

  The full-featured plugin for Amazon GameLift Servers includes UI workflows and sample assets, as well as built-in versions of the AWS SDK and server SDK. The workflows guide you through how to configure and deploy your game server for hosting with managed EC2 fleets, managed container fleets, or self-managed Anywhere fleets. If you don't need the guided workflows, you can get just the server SDK for your game engine from the same GitHub repositories.

  If you're using another game engine or development environment that the plugin doesn't support, get the server SDK for your programming language and add it to your game project.

  For version-specific information and install instructions, see the included readme files in each package.
  + [Plugin for Unreal Engine](https://github.com/amazon-gamelift/amazon-gamelift-plugin-unreal) – Built for use with Unreal Engine versions 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, and 5.6. Check version-specific readme files for Unreal support.
    + [Plugin guide for Unreal Engine](unreal-plugin.md)
    + [C\$1\$1 (Unreal) server SDK 5.x for Amazon GameLift Servers -- Actions](integration-server-sdk5-unreal-actions.md)
  + [Plugin for Unity](https://github.com/amazon-gamelift/amazon-gamelift-plugin-unity) – Built for use with LTS versions of Unity Editor 6.0, 2022.3, or 2021.3. It supports Unity's .NET Framework and .NET Standard profiles, with .NET Standard 2.1 and .NET 4.x. Check version-specific readmes for Unity support.
    + [Plugin guide for Unity](unity-plug-in.md)
    + [C\$1 server SDK 5.x for Amazon GameLift Servers -- Actions](integration-server-sdk5-csharp-actions.md)C\$1 server SDK reference
  + [Server SDK for Unreal](https://github.com/amazon-gamelift/amazon-gamelift-plugin-unreal)
    + [Server SDK reference](integration-server-sdk5-unreal-actions.md)
    + [Integrate Amazon GameLift Serversinto an Unreal Engine project](integration-engines-setup-unreal.md)
  + [Server SDK for Unity](https://github.com/amazon-gamelift/amazon-gamelift-plugin-unity)
    + [Server SDK reference](integration-server-sdk5-csharp-actions.md)
    + [Integrate Amazon GameLift Servers into a Unity project](integration-engines-unity-using.md)

### Runtime support
<a name="gamelift-supported-servers-runtime"></a>

For a managed hosting solution, build your game server to run on one of the following Amazon machine images (AMIs). See [Amazon GameLift Servers AMI versions](reference-ec2-ami-version-history.md) for Amazon GameLift Servers for more details.
+ [Windows Server 2016](https://aws.amazon.com/windows/products/ec2/windows-server-2016/)
+ [Amazon Linux 2023](https://aws.amazon.com/linux/amazon-linux-2023/)
+ [Amazon Linux 2](https://aws.amazon.com/amazon-linux-2/)

**Note**  
Amazon Linux 2 (AL2) will reach end of support on June 30, 2026. See more details in the [Amazon Linux 2 FAQs](https://aws.amazon.com/amazon-linux-2/faqs/). For game servers that are hosted on AL2 and use Amazon GameLift Servers server SDK 4.x, first update the game server build to server SDK 5.x, and then deploy to AL2023 instances. See [Migrate to server SDK 5.x for Amazon GameLift Servers](reference-serversdk5-migration.md).

### Additional tools
<a name="gamelift-supported-servers-tools"></a>

**[Game server wrapper for Amazon GameLift Servers](https://github.com/amazon-gamelift/amazon-gamelift-servers-game-server-wrapper/)**  
This tool helps you deploy a game server for hosting with a set of basic game session management functionality. With this tool, you don't need to make changes to your game code or integrate the server SDK for Amazon GameLift Servers. Use the game server wrapper to package your game server and deploy it for game hosting using any of the three Amazon GameLift Servers hosting solutions (Anywhere, managed EC2, or managed containers). This tool is best suited for early evaluation or prototyping with your own game or a sample game, as this tool doesn't support game server customization. If your game doesn't need custom features, you can deploy your game server with the game server wrapper for production hosting. 

**[Amazon GameLift Servers Toolkit](https://github.com/aws/amazon-gamelift-toolkit)**  
The Amazon GameLift Servers Toolkit is a collection of scripts and other tools that we've developed to help developers with common scenarios and issues. Toolkit materials include scripts, sample code, and readmes. 
+ [ Containers starter kit](https://github.com/aws/amazon-gamelift-toolkit/tree/main/containers-starter-kit) – Use this tool to streamline the tasks of setting up game server builds for hosting with Amazon GameLift Servers managed containers. The kit integrates essential game session management features into a game server, and uses pre-configured templates to create a container fleet and set up an automated deployment pipeline for your game server build. After deployment, you can monitor fleet performance, manage game sessions, and analyze metrics using the Amazon GameLift Servers console and API tools. The kit integrates with AWS CodeBuild for build automation, Amazon Simple Storage Service for storage, and AWS CloudFormation for infrastructure deployment.
+ [ Fast build update tool](https://github.com/aws/amazon-gamelift-toolkit/tree/main/fast-build-update-tool) – Use this tool to modify a game server build that's already deployed to a managed EC2 fleet. The tool is built to help you quickly swap out game build files without having to configure and create new EC2 fleets with every change. You can update individual instances or all instances in the fleet. Options let you replace specific build files or an entire build, and let you manage how to restart game servers after the updates. 

## For game clients
<a name="gamelift-supported-game-clients"></a>

Integrate your game client with the client SDK for Amazon GameLift Servers. The client SDK provides utilities for game clients to use Amazon GameLift Servers features including player gateway and UDP ping beacons.

**Get the client SDK**
+ [Client SDK for C\$1\$1](https://github.com/amazon-gamelift/amazon-gamelift-servers-client-sdk-for-cpp) – Includes player gateway and UDP ping beacons utilities with built-in endpoint selection algorithms, plus a sample application demonstrating integration. Requires C\$1\$117 and a threading library.
+ [Client SDK for Unreal Engine](https://github.com/amazon-gamelift-for-unreal/amazon-gamelift-servers-client-sdk-for-unreal) – Includes player gateway (with or without engine modifications) and UDP ping beacons utilities with built-in endpoint selection algorithms. Requires source-built Unreal Engine 5.1 or later. Access requires membership in the [Epic Games organization on GitHub](https://www.unrealengine.com/en-US/ue-on-github).

For integration guides, see the documentation in each GitHub repository.

## For game backend services
<a name="gamelift-supported-clients"></a>

Create a 64-bit backend service for your game and integrate it with functionality from the AWS SDK, which includes the service API for Amazon GameLift Servers. Use the backend service to handle interactions with the Amazon GameLift Servers service, including starting or finding game sessions and joining players to games.

[Get the AWS SDK](https://aws.amazon.com/developer/tools/#SDKs)

For more information about using the AWS SDK with Amazon GameLift Servers, see the following resources: 
+ [Amazon GameLift Servers API Reference](https://docs.aws.amazon.com/gameliftservers/latest/apireference/Welcome.html)
+ Integrate game client functionality
  + [Client-side service integration for games with custom game server builds](gamelift-sdk-client-api.md)
  + [ Client-side service integration for games with Realtime servers](https://docs.aws.amazon.com/gameliftservers/latest/realtimeguide/realtime-client.html)
+ [Design a backend service](gamelift_quickstart_customservers_designbackend.md)

## For Amazon GameLift Servers resource management
<a name="gamelift-supported-resources"></a>

Use the following tools to create, update, and monitor your Amazon GameLift Servers managed hosting resources. 
+ [AWS Management Console](https://console.aws.amazon.com/) – The AWS Console is a web-based application that provides centralized access to all individual AWS service consoles, including Amazon GameLift Servers. Use the Console to create or sign into an AWS account and open the Amazon GameLift Servers console to work with your game hosting resources. You can configure and deploy hosting fleets and other resources, view usage and performance metrics, track resources in the dashboard, and many other tasks. [Go to the Amazon GameLift Servers console.](https://console.aws.amazon.com//gamelift) 
+ [Service API for Amazon GameLift Servers](https://docs.aws.amazon.com/gameliftservers/latest/apireference/Welcome.html) – This API gives you programmatic access to all of your Amazon GameLift Servers resources. It is part of the AWS SDK, which you can download for use with most popular programming languages. [Get the AWS SDK.](https://aws.amazon.com//developer)
+ [AWS command line interface (CLI)](https://docs.aws.amazon.com/cli/) – The AWS CLI lets you interact with AWS services using a command-line shell. The tools provides direct access to the public APIs for AWS services as well as customized commands that are available for a service. [Get the AWS CLI.](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) 
+ [AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html) for Amazon GameLift Servers – The CloudFormation service helps you model and set up AWS resources to streamline infrastructure deployment and management. Create an CloudFormation template to describe the Amazon GameLift Servers resources for your hosting solution, and then use the template to build additional resources or update configurations. View the [Amazon GameLift Servers resource type reference.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_GameLift.html)

## For Amazon GameLift Servers Realtime
<a name="gamelift-supported-realtime"></a>

Configure and deploy Realtime servers to host your multiplayer games. To allow your game clients to connect to Realtime servers, use the Amazon GameLift Servers Realtime client SDK. To get started, [download the Realtime client SDK](https://aws.amazon.com/gamelift/servers/getting-started/). For configuration information, see [ Integrating a game client for Amazon GameLift Servers Realtime](https://docs.aws.amazon.com/gameliftservers/latest/realtimeguide/realtime-client.html).

**SDK support**

The Realtime Client SDK contains source for the following languages:
+ C\$1 (.NET)

**Development environments**

Build the SDK from source as needed for the following supported development operating systems and game engines:
+ **Operating systems** – Windows, Linux, Android, iOS
+ **Game engines** – Unity, engines that support C\$1 libraries
+ **Node.js runtimes** – 10.x, 24.x
**Note**  
Node.js 10 will reach end of support on September 30, 2026. See more details in the [Node.js 10 FAQs](https://aws.amazon.com/gamelift/faq/nodejs10/). For migration guidance, see [ Migrating from Node.js 10 to 24](https://docs.aws.amazon.com/gamelift/latest/realtimeguide/realtime-script.html#realtime-script-nodejs-migration).

**Game server operating systems**

You can deploy Realtime servers onto hosting resources that run on the following platforms:
+ [Amazon Linux 2023](https://aws.amazon.com/linux/amazon-linux-2023/)
+ [Amazon Linux 2](https://aws.amazon.com/amazon-linux-2/)

# Tutorial: Quick onboarding with the Amazon GameLift Servers wrapper
<a name="gamelift-wrapper-tutorial"></a>

Welcome to the onboarding tutorial for Amazon GameLift Servers. In this tutorial, you rapidly deploy your game server to be hosted on a fleet of cloud-based compute resources. Use this tutorial to skip the work of integrating the server SDK for Amazon GameLift Servers into your game code, and instead deploy your game with the minimal functionality to communicate with the Amazon GameLift Servers service and run game sessions. You will set up a basic hosting solution and use it to experience the full range of features such as automatic scaling and matchmaking. It's also a great way to host a prototype of your game as part of a live demo or for testing.

Key benefits of this onboarding method:
+ Quickly deploy your game server for hosting fast.
+ Zero game code changes and no modifications required.
+ Use this method with any game executable, regardless of game engine.
+ Explore all Amazon GameLift Servers management tools, including monitoring for game session activity and hosting health.

**Note**  
The wrapper is intended for evaluation and basic production use. Advanced features such as detailed player session management require a full server SDK integration.

## Prerequisites
<a name="gamelift-wrapper-tutorial-prerequisites"></a>

Before you begin, ensure you have:
+ An AWS account with appropriate permissions
+ AWS CLI installed
+ Go 1.18\$1
+ A multiplayer game server executable
+ Make (Linux/Mac)
+ Git installed with an active account

## Overview
<a name="gamelift-wrapper-tutorial-overview"></a>

In this tutorial you will:

1. Get and build the wrapper

1. Prepare the game build

1. Configure the wrapper

1. Upload the game server build

1. Create the managed EC2 fleet

1. Create and connect to a game session

1. Monitor and manage your game servers

1. Scale your game servers

## Step 1: Get and build the game server wrapper
<a name="gamelift-wrapper-tutorial-step1"></a>

Use the following commands to get the game server wrapper source and build the wrapper. These commands use SSH, but you can also go to the GitHub repository directly.

### Windows
<a name="gamelift-wrapper-tutorial-step1-windows"></a>

```
> git clone git@github.com:amazon-gamelift/amazon-gamelift-servers-game-server-wrapper.git
> cd amazon-gamelift-servers-game-server-wrapper
> powershell -file .\build.ps1
```

### Mac and Linux
<a name="gamelift-wrapper-tutorial-step1-mac-linux"></a>

```
$ git clone git@github.com:amazon-gamelift/amazon-gamelift-servers-game-server-wrapper.git
$ cd amazon-gamelift-servers-game-server-wrapper
$ make
```

On a successful build, an "out" directory is added to `amazon-gamelift-servers-game-server-wrapper`. In this directory are three folders, one for each supported hosting fleet option, that contain a set of build artifacts. For this tutorial, you're deploying to managed EC2 fleets, so you'll use the folder `gamelift-servers-managed-ec2`.

## Step 2: Prepare your game server build
<a name="gamelift-wrapper-tutorial-step2"></a>

In this step, you prepare your game server build files for uploading to the Amazon GameLift Servers.

### Create the game directory
<a name="gamelift-wrapper-tutorial-step2-create-directory"></a>

Now, prepare a game directory on your local machine. This directory must contain all the files you need to run your game server with Amazon GameLift Servers. This includes the game server wrapper, your game server build and the config.yaml that makes the wrapper work with your game server.

Use the following steps:

1. Managed EC2 fleet. In the game server wrapper output folder, find the build artifact for deploying to a Managed EC2 fleet. The build will be written to an out directory as indicated here: `out\linux\amd64\gamelift-servers-managed-ec2`.

1. Copy your game server executable and all associated files that it requires to run into the `gamelift-servers-managed-ec2` folder. You can have nested directories as needed.

An example directory structure will look like this:

```
gamelift-servers-managed-ec2
│-- config.yaml
│-- amazon-gamelift-servers-game-server-wrapper
│-- MyGame
│   │-- server-executable.exe
│   │-- my-game-settings
│   │ ......
```

## Step 3: Configure the wrapper for your fleet
<a name="gamelift-wrapper-tutorial-step3"></a>

Amazon GameLift Servers manages the lifecycle of a fleet's compute instances, spinning up new instances with your server build installed and recycling instances as needed. The service manages the game server process lifecycle that runs on each instance. A Managed EC2 fleet can have instances in multiple locations to support players wherever they are.

Edit the config.yaml file to configure the wrapper for logging, port setup, and server initialization.

1. **Configure the logging settings**. The game server wrapper generates log messages for each game server process. By default, the log level is set to debug for maximum verbosity. This is really useful during setup and troubleshooting and determines how detailed the log messages are - in this case, the most verbose. Options include debug, info, warn, and error (least verbose).

1. **Specify the path to the game server log directory**. The default path for game server logs is `./game-server-logs`. This directory contains all the logs generated by your game server and each instance has them. The logs are automatically uploaded to Amazon GameLift Servers where they are accessed from the **Events** tab. View the Troubleshooting section for more details.

1. **Define network port configuration**. Set the game port to whatever you prefer. For this tutorial, specify one port only, as you'll create a fleet that runs only one concurrent game server process per instance. If you decide to run multiple processes at a time, you'll need to configure enough ports for each concurrent process. The default value is 37016 as shown in the config file, but in general, for fleets using Linux builds use ports 22 and 1026-60000. For fleets using Windows builds, use ports 1026-60000.

1. **Set up the path to the game server executable**. For `./MyGame/my-server-executable.exe` customize the path to your game server executable with the actual name and location for it. This is the entry point for launching your game server.

1. **Configure the game server arguments**. At a minimum, specify a -port argument and use the same game port value you defined before. The "pos" value 0 indicates this is the first argument. Add other arguments as needed. These arguments are passed to your game server when it's launched, allowing you to configure its runtime behavior.

   1. Argument: `"--port"`

   1. Value: `"{{.port number here}}"`

   1. Position: `0` (First argument in the list)

Example configuration:

```
log-config:
  wrapper-log-level: debug
game-server-logs-dir: ./game-server-logs
ports:
  gamePort: 37016
game-server-details:
  executable-file-path: ./MyGame/my-server-executable
game-server-args:
  - arg: "--port"
    val: "{{.gameport}}"
    pos: 0
```

## Step 4: Upload the game server build
<a name="gamelift-wrapper-tutorial-step4"></a>

You've now completed all the required elements of your game server build (game server wrapper, config.yaml, and your game server files), and you're ready to upload your game build to Amazon GameLift Servers for hosting. The quickest way to upload your game build is by using the AWS CLI command `upload-build` as shown in the following example.

Uploading a game build with Windows:

```
aws gamelift upload-build \
    --name gamelift-test-2025-03-11-1 \
    --build-version gamelift-test-2025-03-11-1 \
    --build-root out/windows/amd64/gamelift-servers-managed-ec2 \
    --operating-system WINDOWS_2022 \
    --server-sdk-version 5.3.0 \
    --region us-west-2
```

**Note**  
For Mac and Linux builds, use --operating-system AMAZON\$1LINUX\$12023

When you create the build, record the build ID from the API response to use it for fleet creation.

## Step 5: Create the managed EC2 fleet
<a name="gamelift-wrapper-tutorial-step5"></a>

The following steps describe a minimal fleet configuration, so you can be up and running as soon as possible.

To create your fleet:

1. Log into the AWS Management Console and navigate to Amazon GameLift Servers.

1. On the menu bar at the top of the console window, check to make sure what region your build is in. Make note of it because your fleet needs to be in the same region or you won't be able to find or choose your build.

1. In the navigation pane in the **Managed EC2** section, choose **Builds**.

1. Select the build you uploaded previously to display the **Build details page**.

1. In the Fleets section choose **Create Fleet** which displays the Define Managed EC2 fleet details page from which you are able to track status for your fleet as well as view fleet creation events on the **Events** tab.

1. Fill out the name and description and choose **Next**.

1. In the Define instance details page the build's region is shown by default. Choose any additional regions you want to add.

1. For **Fleet type** choose **On-Demand**.

1. Under **Instance types** choose **c5.large** and choose **Next**.

1. Under **Runtime configuration**, Because your uploaded game build uses the wrapper, you need to point to the wrapper executable instead. For Windows game servers this is `C:\game\amazon-gamelift-servers-game-server-wrapper.exe` . For Linux game servers, this is `/local/game/amazon-gamelift-servers-game-server-wrapper`.

   For example: `LaunchPath": "/local/game/amazon-gamelift-servers-game-server-wrapper", "ConcurrentExecutions": 1, "Parameters": "—port 37016`

   Also, configure the game port values with a range that allows for the port that was set in the `config.yaml` and the runtime config launch parameters. The port in `config.yaml` does not need to match the one specified in the fleet's runtime configuration, but at runtime if the configuration specifies a different port, that value overrides what is in the `config.yaml`. Launch parameters entered in the runtime config also override what is in the `config.yaml`.

1. On the **Review and create** page, double-check all configurations, then choose **Submit** to create your fleet. The fleet status will change as it spins up capacity to host the game server, and very soon shows a status of **Active**. Once activation is complete and the fleet deployed, the service launches the wrapper which is ready to receive a game session request.

## Step 6: Create and connect to a game session
<a name="gamelift-wrapper-tutorial-step6"></a>

When your fleet status shows **Active**, this means that game servers are ready and waiting to host a game session. To start a game session, make a game session request to the Amazon GameLift Servers service. Here, you will use the AWS CLI to make this request.

**Note**  
Keep in mind that creating a game session using the AWS CLI is useful for testing and becoming familiar with the process. At some point, you'll add programmatic AWS SDK calls to your game backend service as part of your game's matchmaking or game session placement system.

Use the following to create a game session:

```
aws gamelift create-game-session \
--fleet-id <FLEET_ID> \
--game-properties '[{"Key": "exampleProperty", "Value": "exampleValue"}]' \
--maximum-player-session-count 3 \
--region us-west-2
```

You can also pass customized game properties to your server executable. See the Game Server Arguments in the README for details. When it receives the create-game-session call, the Amazon GameLift Servers inform the wrapper to launch the game server executable and start a game session. What is in the `config.yaml` affects the game server's configuration, and the launch parameters that are set in the console determine the configuration of the game session itself.

Example format for adding game properties:

```
defaultArgs:
        - arg: "--port"
          val: "{{.GamePort}}"
          pos: 0
        - arg: "--ipAddress"
          val: "{{.IpAddress}}"
          pos: 1
        - arg: "--gameSessionId"
          val: "{{.GameSessionId}}"
          pos: 2
```

## Step 7: Manage and monitor your fleet
<a name="gamelift-wrapper-tutorial-step7"></a>

Now that your game server fleet is set up and a game session started, you can manage and monitor it from the Amazon GameLift Servers console. The best way to accomplish this is from the Fleet details page where you can edit fleet details or change fleet scaling and capacity on the **Scaling** tab. See the following section about scaling your game servers.

Choose the **Metrics** tab to view graphs depicting monitoring for Activity and Hardware metrics. For details about the metrics graphs, choose the **Info** link next to your fleet's ID. Additionally, while you can closely monitor your game servers from the **Metrics** tab, you can also add alarms to these metrics in the CloudWatch dashboard.

To navigate to the CloudWatch dashboard from the console:

1. Type "CloudWatch" in the search bar and choose it from the search results list to display the CloudWatch Overview.

1. Scroll down and choose **View GameLift dashboard** to see graphs based on key metrics for your fleets and game sessions.

## Step 8: Scale your game servers
<a name="gamelift-wrapper-tutorial-step8"></a>

For the next step, you set up auto scaling. With auto scaling you dynamically scale your fleet capacity in response to game server activity. As players arrive and start game sessions, auto scaling adds more instances, and as player demand decreases, auto scaling releases unused instances. This is an effective way to minimize your hosting resources and costs while still providing a smooth, fast player experience.

As you prepare for game launch, you'll want to set up auto scaling for your fleets. Auto scaling is recommended as an effective way to minimize your hosting resources and costs while still providing a smooth, fast player experience.

### To manually set up fleet capacity
<a name="gamelift-wrapper-tutorial-step8-manual"></a>

To manually set up fleet capacity

1. Go to the **Scaling** tab in the details page for your fleet.

1. Select a location and choose **Edit**.

1. Change the **Desired instances** value and change the **Min** and **Max** size settings in order to scale beyond their current values, and choose **Confirm**.

**Note**  
Use the max instances setting as a stop gap to prevent excessive scaling and costs.

### To use target-based auto scaling
<a name="gamelift-wrapper-tutorial-step8-target-based"></a>

To use target-based auto scaling

Target-based autoscaling (target tracking) links fleet scaling to the percentage of available game sessions. As players surge to play your game and available game sessions decrease, it responds by automatically adding more instances to the fleet.

1. Under **Target-based auto scaling policy**, choose **Add policy** and set the fleet's capacity to change automatically when it reaches the threshold of the percentage of available game sessions that you set. A larger buffer can better handle surges, getting new players get into games fast, but it may also lead to higher hosting costs.

1. Choose **Confirm** to accept the changes.

Rule-based auto scaling gives you more granular control, such as the ability to link scaling to other fleet metrics and set custom thresholds and scaling responses. It offers powerful options, but it also requires using the CLI and significant testing to understand how custom rules behave in action. This tutorial focuses on first setting up the target-based approach.

## Troubleshoot common issues
<a name="gamelift-wrapper-tutorial-troubleshoot"></a>

The following are common issues you may encounter while getting your game servers and game sessions running. When either the server or the game session isn't running properly, the first step is to check the logs which may reveal one of the issues described below for new deployments or games in production.

The following is often revealed in the logs:
+ Game server process can't launch. This might be an error in the wrapper config—verify the file has the right launch path and correct launch parameters and arguments.
+ Game server build isn't runnable. This is likely an error in the game code.
+ Players can't connect to game sessions. This is likely a port configuration error.
+ Lag or slow connections. Review scaling policies and thresholds.
+ No connection. Verify the port rules and configuration for your fleet.

### To view the event logs for your Amazon GameLift Servers fleet
<a name="gamelift-wrapper-tutorial-troubleshoot-fleet-logs"></a>

To view the event logs for your Amazon GameLift Servers fleet

1. Open the Amazon GameLift Servers console.

1. On the Fleet Details page choose the **Events** tab and download the log. You can also monitor activity and hardware metrics for game server health and game session activations from the **Metrics** tab.

### To view game session logs
<a name="gamelift-wrapper-tutorial-troubleshoot-session-logs"></a>

To view game session logs

1. From the console, open your fleet and open the **Game sessions** tab.

1. Choose a game session ID from the list to display the Overview page for it.

1. Choose **Download logs** to download a log file locally.

To view game session logs with the CLI use the `GetGameSessionLogURL` API. Amazon GameLift Servers automatically stores the logs for 14 days.

You can also configure Amazon CloudWatch logs for your fleet. This provides additional logging capabilities and integration with other AWS monitoring services.

For real-time log access or extended retention periods through CloudWatch:

1. At the top of your Amazon GameLift Servers console dashboard type "CloudWatch" in the search bar and choose it from the results drop-down.

1. Go to the CloudWatch Log Groups and search for specific sessions. The easiest method is to click **Search All** and filter using gameSessionId or clientId.

## Next steps
<a name="gamelift-wrapper-tutorial-next-steps"></a>
+ [Create a multi-location fleet to add hosting in additional locations](gamelift-regions.md#gamelift-regions-hosting)
+ [Add a game session queue to make the best possible placements for game sessions across multiple locations](queues-intro.md)
+ [Experiment with FlexMatch matchmaking by creating a matchmaker and rule set for your game](https://docs.aws.amazon.com/gameliftservers/latest/flexmatchguide/match-intro.html)
+ [Start working on functionality for your game client and backend service components, so players can make join requests and directly connect to game sessions](gamelift-sdk-client-api.md)
+ [When ready, move to a fully-integrated solution](gamelift-roadmap-managed.md)

# Amazon GameLift Servers examples
<a name="getting-started-examples"></a>

If you're considering using Amazon GameLift Servers to manage your custom game server, or you're interested in taking advantage of Amazon GameLift Servers Realtime, we recommend that you try the following examples before you use the service for your own game. The custom game server example gives you experience with game hosting in the Amazon GameLift Servers console. The Amazon GameLift Servers Realtime example shows you how to prepare a game for hosting using Realtime servers.

## Custom game server example
<a name="gamelift-explore-deploycustomsample"></a>

This example demonstrates the process of deploying a sample game server to Amazon GameLift Servers managed EC2 fleet for hosting. Use the sample game client to connect to a live game session. You can experience how to use Amazon GameLift Servers .tools, including the console and the AWS CLI, to monitor the fleet's hosting performance and usage.

The example walks you through the following steps:
+ Upload the sample game server build.
+ Create a fleet to run the game server build.
+ Get the sample game client and use it to connect to a game server and join a game session.
+ Review fleet and game session metrics.

Start up multiple game clients and play the game to generate hosting data. Use the Amazon GameLift Servers console to view hosting resources, track metrics, and explore options for scaling the fleet's hosting capacity.

To get started, sign in to the [Amazon GameLift Servers console](https://console.aws.amazon.com/gamelift/sample-game). In the left-side navigation, go to **Resources**, **Try a sample game**.