Class GameServerGroup

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.gamelift.alpha.GameServerGroupBase
software.amazon.awscdk.services.gamelift.alpha.GameServerGroup
All Implemented Interfaces:
IResource, IGameServerGroup, IGrantable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.102.0 (build e354887)", date="2024-08-29T22:54:27.692Z") @Stability(Experimental) public class GameServerGroup extends GameServerGroupBase
(experimental) Creates a GameLift FleetIQ game server group for managing game hosting on a collection of Amazon EC2 instances for game hosting.

This operation creates the game server group, creates an Auto Scaling group in your AWS account, and establishes a link between the two groups. You can view the status of your game server groups in the GameLift console. Game server group metrics and events are emitted to Amazon CloudWatch. Before creating a new game server group, you must have the following:

  • An Amazon EC2 launch template that specifies how to launch Amazon EC2 instances with your game server build.
  • An IAM role that extends limited access to your AWS account to allow GameLift FleetIQ to create and interact with the Auto Scaling group.

To create a new game server group, specify a unique group name, IAM role and Amazon EC2 launch template, and provide a list of instance types that can be used in the group. You must also set initial maximum and minimum limits on the group's instance count. You can optionally set an Auto Scaling policy with target tracking based on a GameLift FleetIQ metric.

Once the game server group and corresponding Auto Scaling group are created, you have full access to change the Auto Scaling group's configuration as needed. Several properties that are set when creating a game server group, including maximum/minimum size and auto-scaling policy settings, must be updated directly in the Auto Scaling group. Keep in mind that some Auto Scaling group properties are periodically updated by GameLift FleetIQ as part of its balancing activities to optimize for availability and cost.

Example:

 ILaunchTemplate launchTemplate;
 IVpc vpc;
 GameServerGroup.Builder.create(this, "GameServerGroup")
         .gameServerGroupName("sample-gameservergroup-name")
         .instanceDefinitions(List.of(InstanceDefinition.builder()
                 .instanceType(InstanceType.of(InstanceClass.C5, InstanceSize.LARGE))
                 .build(), InstanceDefinition.builder()
                 .instanceType(InstanceType.of(InstanceClass.C4, InstanceSize.LARGE))
                 .build()))
         .launchTemplate(launchTemplate)
         .vpc(vpc)
         .vpcSubnets(SubnetSelection.builder().subnetType(SubnetType.PUBLIC).build())
         .build();
 

See Also:
  • Constructor Details

    • GameServerGroup

      protected GameServerGroup(software.amazon.jsii.JsiiObjectRef objRef)
    • GameServerGroup

      protected GameServerGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • GameServerGroup

      @Stability(Experimental) public GameServerGroup(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull GameServerGroupProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details