Create an Amazon GameLift managed container fleet - Amazon GameLift

Create an Amazon GameLift managed container fleet

When you've created your container group definitions, use the Amazon GameLift console or the AWS Command Line Interface (AWS CLI) to create a container fleet.

After you create a new fleet, the fleet's status passes through several stages as Amazon GameLift deploys your container groups onto each fleet instance and starts the game servers. When the fleet reaches status ACTIVE, it's ready to host game sessions. For help with fleet creation issues, see Debug Amazon GameLift fleet issues.

Console

In the Amazon GameLift console, select the AWS Region where you want to create the fleet. The container group definitions must be in the same region where you want to create the fleet.

Open the console’s left navigation bar and choose Managed containers: Fleets. On the Fleets page, choose Create container fleet.

Step 1: Define managed container fleet details
  1. In the Container fleet details section, enter a fleet description.

  2. Specify an IAM role for the fleet. This role has permissions that Amazon GameLift must have to manage the container fleet on your behalf. For help creating the required service role, see Set up an IAM service role for Amazon GameLift.

  3. Choose a Log configuration option. The CloudWatch option is selected by default. Provide the required information based on your selected option.

  4. Add container groups to the fleet. This is an optional step. You can choose to create a fleet without a container group with a plan to add them later. A fleet without any container groups won't deploy any fleet instances and can't host any games yet, but the fleet resource is created.

    • Select a game server container group definition. Optionally specify the version of the definition that you want to deploy. If you don’t specify the version number, Amazon GameLift automatically uses the latest version.

    • Optionally add a per-instance container group definition and version. If you don’t specify the version number, Amazon GameLift automatically uses the latest version.

  5. In the Additional details, you can set some optional customizations. None of these settings are required to create the container fleet.

Step 2: Define instance details
  1. In Instance deployment, select one or more remote locations to deploy instances to. The home Region is automatically selected (this is the Region that you're creating the fleet in). 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.

  2. Select an Instance configuration for the fleet. The console automatically calculates the minimum vCPU and memory required (based on the total limits you set for each container group). It filters the complete list of available instance types base on resource requirements and the locations you entered. You can add additional filters as needed.

    For more information about choosing an instance type, see Configure a container fleet. The size of the instance type you choose will impact how game server container groups are packed onto each fleet instance. Depending on your choice, consider reviewing your setting for desired game server container groups per instance.

Step 4: Review and create
  • Review your fleet configuration settings.

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

    When you're finished reviewing, choose Create.

    If your request is successful, the console displays the detail page for the new fleet resource. Initially the status is NEW, as Amazon GameLift starts the fleet creation process. You can track the new fleet's status on the Fleets page. A fleet is ready to host game sessions when it reaches status ACTIVE.

AWS CLI

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

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

  • The ContainerGroupsConfiguration specifies a game server container group definition only: MyAdventureGameContainerGroup. The number of game server container groups that will be deployed to each fleet instance is calculated by Amazon GameLift.

  • The fleet uses c5.large On-Demand instances by default.

  • By default, the fleet opens a set of connection ports and inbound permissions ports as calculated by Amazon GameLift. It deploys container groups to the following locations:

aws gamelift create-container-fleet \ --fleet-role-arn arn:aws:iam::MyAccount:role/MyContainersRole \ --game-server-container-group-definition-name "rn:aws:gamelift:us-west-2:111122223333:containergroupdefinition/MyAdventureGameContainerGroup:2" \

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 container fleet ID. Amazon GameLift then sets the fleet status and location statuses to New and initiates the fleet activation process. 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: