Manage Amazon GameLift FleetIQ game server groups
This topic describes the tasks required to set up a Amazon GameLift FleetIQ game server group. Creating a game server group triggers the creation of an EC2 Auto Scaling group with all the necessary configuration settings, along with configuration to manage Amazon GameLift FleetIQ optimizations for game hosting.
Before you can create a game server group, you must at minimum have the following resources prepared:
-
An Amazon EC2 launch template that specifies how to launch Amazon EC2 instances with your game server build. For more information, see Launching an Instance from a Launch Template in the Amazon EC2 User Guide.
-
An IAM role that extends limited access to your AWS account to allow GameLift FleetIQ to create and interact with the Auto Scaling group. For more information, see Create IAM roles for cross-service interaction.
Create a game server group
To create a game server group, call CreateGameServerGroup(). This operation creates both a Amazon GameLift FleetIQ game server group and a corresponding Auto Scaling group. When you create the game server group, you provide game-specific settings for Amazon GameLift FleetIQ, including balancing strategy and instance type definitions. You also provide initial property settings for the Auto Scaling group.
The following example triggers the creation of a GameServerGroup
that
specifies c4.large and c5.large instance types and limits the group to Spot Instances
only, and an Auto Scaling group that uses the specified launch template for deploying
instances and manages group capcity within the minimum and maximum settings using a
target-tracking automatic scaling policy. After a short provisioning period, an
AutoScalingGroup
resource is created, and the
GameServerGroup
enters an ACTIVE state.
AWS gamelift create-game-server-group \ --game-server-group-name MyLiveGroup \ --role-arn arn:aws:iam::123456789012:role/GameLiftGSGRole \ --min-size 1 \ --max-size 10 \ --game-server-protection-policy FULL_PROTECTION \ --balancing-strategy SPOT_ONLY \ --launch-template LaunchTemplateId=lt-012ab345cde6789ff \ --instance-definitions '[{"InstanceType": "c4.large"}, {"InstanceType": "c5.large"}]' \ --auto-scaling-policy '{"TargetTrackingConfiguration": {"TargetValue": 66}}'
Update a game server group
You can update game server group properties that affect how Amazon GameLift FleetIQ manages hosting for game servers, including resource type optimizations. To update these properties, call UpdateGameServerGroup(). After the changes to the game server group take effect, Amazon GameLift FleetIQ may overwrite certain properties in the Auto Scaling group.
For all other Auto Scaling group properties, such as MinSize
,
MaxSize
, and LaunchTemplate
, you can modify these directly
on the Auto Scaling group.
In the example below, the instance type definitions are updated to switch over to c4.xlarge and c5.xlarge instances types.
AWS gamelift update-game-server-group \ --game-server-group-name MyLiveGroup \ --instance-definitions '[{"InstanceType": "c4.xlarge"}, {"InstanceType": "c5.xlarge"}]'
Track game server group instances
After you create and deploy instances to your game server group and Auto Scaling group, you can track the status of game server instances by calling DescribeGameServerInstances(). You can use this operation to track instance status.. For more information on game server group status, see Life of a game server group.
You can also use the Amazon GameLift console