Create a Amazon GameLift managed fleet - Amazon GameLift

Create a Amazon GameLift managed fleet

Use either the Amazon GameLift console or the AWS Command Line Interface (AWS CLI) to create a managed fleet.

After you create a new managed EC2 fleet, the fleet's status passes through several stages as Amazon GameLift deploys the fleet and installs and starts the game servers. The fleet is ready to host game sessions, after it reaches ACTIVE status. For help with fleet creation issues, see Debug Amazon GameLift fleet issues.

Console
To create a managed EC2 fleet

In the Amazon GameLift console, use the navigation pane to open the Fleets page. Choose Create fleet to start the fleet creation workflow.

Step 1 Choose compute type

Select the Managed EC2 option and choose Next.

Step 2 Define fleet details

In this step, specify some key fleet-wide settings.

  1. Fill out the Fleet details section:

    1. Enter a fleet Name. We recommend using a fleet naming pattern that makes it easier to identify fleet types when viewing lists of fleets.

    2. Provide a short Description of the fleet.

    3. For Binary type, select Build to indicate that you're deploying a custom game server build, or select or Script if you're deploying Realtime Servers to this fleet. Select an uploaded build or script from the dropdown list.

  2. Set Additional details as needed. This is the only time that you can apply these optional settings. They can't be changed after you create the fleet.

    1. If your game server executable needs to access other AWS resources in your account, specify an IAM Instance role with the necessary permissions. For more information, including how to authorize other server-side applications (such as CloudWatch agent), see Communicate with other AWS resources from your fleets.

      You must create the role before you create a fleet that uses it. In addition, to create a fleet with an instance role, your AWS user must have IAM PassRole permission (see IAM permission examples for Amazon GameLift).

    2. Turn on the Generate a TLS certificate option to set up authentication and encryption for your game, Game clients use this certificate to authenticate a game server when connecting and encrypt all client/server communication. For each instance in a TLS-enabled fleet, Amazon GameLift also creates a new DNS entry with the certificate.

    3. If you want to combine metrics for this fleet and others, specify a Metric group name. Use the same metric group name for all fleets that you want to combine together. View metrics for the metric group to see aggregated data.

  3. Add optional Tags to the fleet resource by entering Key and Value pairs. You can use tags to search for and filter your resources or track your AWS costs.

  4. Choose Next to continue the workflow.

Step 3 Define instance details

In this step, you specify the type of hosting resources to use and where you want to deploy them. By choosing multiple locations, you can place game servers closer to your players and minimize latency. Not all resource types are available in all locations.

  1. In Instance deployment, specify fleet locations and type.

    1. Select one or more additional Locations where you want to deploy fleet instances. These remote locations are added to the fleet's home location (pre-selected), which is the AWS Region where you're creating this fleet. You can select remote locations from all AWS Regions and Local Zones that Amazon GameLift supports. See Amazon GameLift service locations for information about remote locations. Review the Amazon GameLift quotas on locations per fleet.

      Important

      To use Regions that aren't enabled by default, enable them in your AWS account.

      • Fleets with Regions that aren't enabled that you created before February 28, 2022 are unaffected.

      • To create new multi-location fleets or to update existing multi-location fleets, first enable any Regions that you choose to use.

      For more information about Regions that aren't enabled by default and how to enable them, see Managing AWS Regions in the AWS General Reference.

    2. Choose to use either On-demand or Spot instances for this fleet. For more information about fleet types, see On-Demand Instances versus Spot Instances.

  2. Choose an Amazon EC2 Instance configuration that meets your needs and is available in all your selected locations. This list is filtered based on your current instance deployment selections. You can filter it further by other factors such as instance type family and architecture (x64 or Arm). After you create the fleet, you can't change the instance type.

    Some locations have limited instance type options. If your preferred instance type is not available for all locations, choose the location availability value to view full details. To accommodate all locations, you might need to create separate fleets with different instance types.

    For more information about choosing an instance type, see Instance types. To learn more about Amazon EC2 Arm architectures, see AWS Graviton Processor and Amazon EC2 instance types. For a complete list of instance types supported by Amazon GameLift, see the API reference for EC2InstanceType (CreateFleet()).

    Note

    Graviton Arm instances require an Amazon GameLift server build on Linux OS. Server SDK 5.1.1 or newer is required for C++ and C#. Server SDK 5.0 or newer is required for Go. These instances provide no out-of-the-box support for Mono installation on Amazon Linux 2023 (AL2023) or Amazon Linux 2 (AL2).

  3. Choose Next to continue the workflow.

Step 4 Configure runtime
  1. Create a Runtime configuration to instruct Amazon GameLift on how to run server processes on each instance in the fleet. At a minimum, create a single configuration for your game server executable. You can change a fleet's runtime configuration at any time after deployment.

    1. Enter the Launch path to an executable file in your build. On Windows instances, game server executables are built to the path C:\game. On Linux instances, game servers are built to /local/game. Examples: C:\game\MyGame\server.exe, /local/game/MyGame/server.exe, or MyRealtimeLaunchScript.js.

    2. Enter optional Launch parameters to pass to your game executable. Example: +sv_port 33435 +start_lobby.

    3. Specify the number of Concurrent processes to run on each instance. For a game server executable, each process can host one game session, so concurrent processes determines the number of game sessions the instance can host simultaneously.

      Review the Amazon GameLift quotas on server processes per instance. These quotas apply to the total concurrent processes for all configurations. If you configure the fleet to exceed them, the fleet can't activate.

  2. Use the Game session activation defaults or customize them for your game. If the runtime configuration calls for multiple concurrent game server process per instance, these settings determine how quickly new game sessions can start up.

    1. Set Max concurrent game session activation to limit the number of game servers on an instance that are preparing a new game session. This setting is useful when launching multiple new game sessions is resource-intensive and might impact the performance of other running game sessions.

    2. Set the New activation timeout to reflect the maximum amount of time a new game session should take to complete activation and report ready to host players. Amazon GameLift terminates a game session activation if it exceeds this value.

  3. Open EC2 port settings to allow inbound traffic to access server processes on the fleet. These settings aren't required to create a fleet, but you do need set them before players can connect to game sessions on the fleet.

    For each port setting, choose the Type of data transfer protocol to use for communication between your game client and game server. Provide a Port range (in format nnnnn[-nnnnn]) and an IP address range using CIDR notation (such as 0.0.0.0/0 which allows access to anyone).

    If you need to set multiple non-consecutive ranges, create multiple port settings.

  4. Specify optional Game session resource settings. You can update these settings any time after deployment.

    1. Turn Game scaling protection policy on or off for all instances in the fleet. During a scale-down event, Amazon GameLift won't terminate protected fleet instances if they're hosting active game sessions.

    2. Set a maximum Resource creation limit if you want to restrict the number of game sessions that one player can create during a specified time span.

  5. Choose Next to continue the workflow.

Step 5 Review and create

Review your settings before creating the fleet. Although some settings can be updated later (see Manage your Amazon GameLift fleets), changes to the following settings aren't allowed:

  • Compute type: You can't convert a managed EC2 fleet to an Anywhere fleet.

  • Build or script: To deploy an update to your game server build or script, you must create a new fleet.

  • Additional options, including instance role and TLS certificate generation.

  • Instance details, including fleet type (Spot or On-Demand) and EC2 instance type.

When you're ready to deploy the new fleet, choose Create. Amazon GameLift immediately begins the fleet activation process, assigning a unique ID and placing the fleet in NEW status. You can track the fleet's progress on the Fleets page.

As part of the fleet creation process, Amazon GameLift deploys a single instance with your game server software. After the fleet reaches ACTIVE status, you can update the fleet's hosting capacity to add instances. For more information, see Scaling Amazon GameLift hosting capacity.

AWS CLI

To create a fleet with the AWS CLI, open a command line window and use the create-fleet command. For more information about the create-fleet command, see create-fleet in the AWS CLI Command Reference.

The example create-fleet request shown below creates a new fleet with the following characteristics:

  • The fleet uses c5.large On-Demand Instances with the operating system that's appropriate for the selected game build.

  • It deploys the specified game server build, which must be in a Ready status to the following locations:

    • us-west-2 (home Region)

    • sa-east-1 (remote location)

  • TLS certificate generation is enabled.

  • Each instance in the fleet will run ten identical processes of the game server concurrently, enabling each instance to host up to ten game sessions simultaneously.

  • On each instance, Amazon GameLift allows two new game sessions to activate at the same time. It also terminates any activating game session if they aren't ready to host players within 300 seconds.

  • All game sessions hosted on instances in this fleet have game session protection turned on.

  • Individual players can create three new game sessions within a 15-minute period.

  • Each game session hosted on this fleet has a connection point that falls within the specified IP address and port ranges.

  • Amazon GameLift adds metrics for this fleet to the EMEAfleets metric group, which (in this example) combines metrics for all fleets in EMEA Regions.

aws gamelift create-fleet \ --name SampleFleet123 \ --description "The sample test fleet" \ --ec2-instance-type c5.large \ --region us-west-2 \ --locations "Location=sa-east-1" \ --fleet-type ON_DEMAND \ --build-id build-92f061ed-27c9-4a02-b1f4-6f85b2385620 \ --certificate-configuration "CertificateType=GENERATED" \ --runtime-configuration "GameSessionActivationTimeoutSeconds=300, MaxConcurrentGameSessionActivations=2, ServerProcesses=[{LaunchPath=C:\game\Bin64.dedicated\MultiplayerSampleProjectLauncher_Server.exe, Parameters=+sv_port 33435 +start_lobby, ConcurrentExecutions=10}]" \ --new-game-session-protection-policy "FullProtection" \ --resource-creation-limit-policy "NewGameSessionsPerCreator=3, PolicyPeriodInMinutes=15" \ --ec2-inbound-permissions "FromPort=33435,ToPort=33435,IpRange=0.0.0.0/0,Protocol=UDP" "FromPort=33235,ToPort=33235,IpRange=0.0.0.0/0,Protocol=UDP" \ --metric-groups "EMEAfleets"

If the create-fleet request is successful, Amazon GameLift returns a set of fleet attributes that includes the configuration settings you requested and a new fleet ID. Amazon GameLift then initiates the fleet activation process and sets the fleet status and the location statuses to New. You can track the fleet's status and view other fleet information using these CLI commands:

You can change the fleet's capacity and other configuration settings as needed using these commands: