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
  1. In the Amazon GameLift console, in the navigation pane, choose Fleets.

  2. On the Fleets page, choose Create fleet.

  3. Choose Managed EC2.

  4. On the Fleet details page do the following:

    1. For Name, enter a fleet name. We recommend including the fleet type (Spot or On-demand) in your fleet names. This makes it much easier to identify fleet types when viewing a list of fleets.

    2. For Description, provide a short description of the fleet.

    3. For Binary type, select Build or Script to define the game server type that Amazon GameLift deploys to this fleet.

    4. Select a Script or Build from the dropdown list of uploaded scripts or builds.

  5. (Optional) Under Additional details for the following:

    1. For Instance role, specify an IAM role that authorizes applications in your game build to access other AWS resources in your account. For more information, see Communicate with other AWS resources from your fleets. To create a fleet with an instance role, your account must have the IAM PassRole permission. For more information, see IAM permission examples for Amazon GameLift.

      If you want to authorize applications that are not server executables, such as a CloudWatch agent, enable the shared credentials option.

      You can't update these settings after fleet creation.

    2. For Certification generation, choose to have Amazon GameLift Generate a TLS certificate for the fleet. You can use a fleet TLS certificate to have your game client 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. Use these resources to set up authentication and encryption for your game.

    3. For Metric group, Enter the name of a new or existing fleet metric group. You can aggregate the metrics for multiple fleets by adding them to the same metric group.

      You can't update the metric group after fleet creation.

  6. Choose Next.

  7. On the Select locations page, select one or more additional remote locations to deploy instances to. The home Region is automatically selected based on the Region you are accessing the console from. If you select additional locations, fleet instances are also deployed in these locations.

    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.

  8. Choose Next.

  9. On the Define instance details page, choose

    1. On-demand or Spot instances for this fleet. For more information about fleet types, see On-Demand Instances versus Spot Instances.

    2. From the Filter architecture menu choose x64 or Arm.

      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).

      For information on Amazon EC2 Arm architectures, see AWS Graviton Processor and Amazon EC2 instance types.

    For information on the instance types supported by Amazon GameLift, see the EC2InstanceType values under CreateFleet() request parameters.

  10. Select an Amazon EC2 Instance type from the list. For more information about choosing an instance type, see Instance types. After you create the fleet, you can't change the instance type.

  11. Choose Next.

  12. On the Configure runtime page, under Runtime configuration do the following:

    1. For Launch path, enter the path to the game executable in your build or script. On Windows instances, game servers 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. (Optional) For Launch parameters, enter information to pass to your game executable as a set of command line parameters. Example: +sv_port 33435 +start_lobby.

    3. For Concurrent processes, choose the number of server processes to run concurrently on each instance in the fleet. Review the Amazon GameLift limits on number of concurrent server processes.

      Limits on concurrent server processes per instance apply to the total of concurrent processes for all configurations. If you configure the fleet to exceed the limit, the fleet can't activate.

  13. Under Game session activation, provide limits for activating new game sessions on the instances in this fleet:

    1. For Max concurrent game session activation, enter the number of game sessions on an instance that activate at the same time. This limit is useful when launching multiple new game sessions may have an impact on the performance of other game sessions running on the instance.

    2. For New activation timeout, enter how long to wait for a session to activate. If the game session doesn't move to ACTIVE status before the timeout, Amazon GameLift terminates the game session activation.

  14. (Optional) Under EC2 port settings, do the following:

    1. Choose Add port setting to define access permissions for inbound traffic connecting to the server process deployed on the fleet.

    2. For Type, choose Custom TCP or Custom UDP.

    3. For Port range, Enter a range of port numbers that allow inbound connections. A port range must use the format nnnnn[-nnnnn], with values between 1026 and 60000. Example: 1500 or 1500-20000.

    4. For IP address range, Enter a range of IP addresses. Use CIDR notation. Example: 0.0.0.0/0 (This example allows access to anyone trying to connect.)

  15. (Optional) Under Game session resource settings do the following:

    1. For Game scaling protection policy, Turn on or off scaling protection. Amazon GameLift won't terminate instance with protection during a scale down event if they're hosting an active game session.

    2. For Resource creation limit, enter a maximum number of game sessions a player can create during the policy period.

  16. Choose Next.

  17. (Optional) Add tags to the build by entering Key and Value pairs. Choose Next to continue to fleet creation review.

  18. Choose Create. Amazon GameLift assigns an ID to the new fleet and begins the fleet activation process. You can track the new fleet's status on the Fleets page.

You can update the fleet's metadata and configuration at any time, regardless of fleet status. For more information, see Manage your Amazon GameLift fleets. You can update fleet capacity after the fleet has reached ACTIVE status. For more information, see Scaling Amazon GameLift hosting capacity. You can also add or remove remote locations.

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: