GameServerGroupProps

class aws_cdk.aws_gamelift_alpha.GameServerGroupProps(*, game_server_group_name, instance_definitions, launch_template, vpc, auto_scaling_policy=None, balancing_strategy=None, delete_option=None, max_size=None, min_size=None, protect_game_server=None, role=None, vpc_subnets=None)

Bases: object

(experimental) Properties for a new Gamelift FleetIQ Game server group.

Parameters:
  • game_server_group_name (str) – (experimental) A developer-defined identifier for the game server group. The name is unique for each Region in each AWS account.

  • instance_definitions (Sequence[Union[InstanceDefinition, Dict[str, Any]]]) – (experimental) The set of Amazon EC2 instance types that GameLift FleetIQ can use when balancing and automatically scaling instances in the corresponding Auto Scaling group.

  • launch_template (ILaunchTemplate) – (experimental) The Amazon EC2 launch template that contains configuration settings and game server code to be deployed to all instances in the game server group. After the Auto Scaling group is created, update this value directly in the Auto Scaling group using the AWS console or APIs. NOTE: If you specify network interfaces in your launch template, you must explicitly set the property AssociatePublicIpAddress to true. If no network interface is specified in the launch template, GameLift FleetIQ uses your account’s default VPC.

  • vpc (IVpc) – (experimental) The VPC network to place the game server group in. By default, all GameLift FleetIQ-supported Availability Zones are used. You can use this parameter to specify VPCs that you’ve set up. This property cannot be updated after the game server group is created, and the corresponding Auto Scaling group will always use the property value that is set with this request, even if the Auto Scaling group is updated directly.

  • auto_scaling_policy (Union[AutoScalingPolicy, Dict[str, Any], None]) – (experimental) Configuration settings to define a scaling policy for the Auto Scaling group that is optimized for game hosting. The scaling policy uses the metric PercentUtilizedGameServers to maintain a buffer of idle game servers that can immediately accommodate new games and players. After the Auto Scaling group is created, update this value directly in the Auto Scaling group using the AWS console or APIs. Default: no autoscaling policy settled

  • balancing_strategy (Optional[BalancingStrategy]) – (experimental) Indicates how GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances in the game server group. Default: SPOT_PREFERRED

  • delete_option (Optional[DeleteOption]) – (experimental) The type of delete to perform. To delete a game server group, specify the DeleteOption Default: SAFE_DELETE

  • max_size (Union[int, float, None]) – (experimental) The maximum number of instances allowed in the Amazon EC2 Auto Scaling group. During automatic scaling events, GameLift FleetIQ and EC2 do not scale up the group above this maximum. After the Auto Scaling group is created, update this value directly in the Auto Scaling group using the AWS console or APIs. Default: the default is 1

  • min_size (Union[int, float, None]) – (experimental) The minimum number of instances allowed in the Amazon EC2 Auto Scaling group. During automatic scaling events, GameLift FleetIQ and Amazon EC2 do not scale down the group below this minimum. In production, this value should be set to at least 1. After the Auto Scaling group is created, update this value directly in the Auto Scaling group using the AWS console or APIs. Default: the default is 0

  • protect_game_server (Optional[bool]) – (experimental) A flag that indicates whether instances in the game server group are protected from early termination. Unprotected instances that have active game servers running might be terminated during a scale-down event, causing players to be dropped from the game. Protected instances cannot be terminated while there are active game servers running except in the event of a forced game server group deletion. An exception to this is with Spot Instances, which can be terminated by AWS regardless of protection status. Default: game servers running might be terminated during a scale-down event

  • role (Optional[IRole]) – (experimental) The IAM role that allows Amazon GameLift to access your Amazon EC2 Auto Scaling groups. Default: - a role will be created with default trust to Gamelift and Autoscaling service principal with a default policy GameLiftGameServerGroupPolicy attached.

  • vpc_subnets (Union[SubnetSelection, Dict[str, Any], None]) – (experimental) Game server group subnet selection. Default: all GameLift FleetIQ-supported Availability Zones are used.

Stability:

experimental

ExampleMetadata:

infused

Example:

# launch_template: ec2.ILaunchTemplate
# vpc: ec2.IVpc


gamelift.GameServerGroup(self, "GameServerGroup",
    game_server_group_name="sample-gameservergroup-name",
    instance_definitions=[gamelift.InstanceDefinition(
        instance_type=ec2.InstanceType.of(ec2.InstanceClass.C5, ec2.InstanceSize.LARGE)
    ), gamelift.InstanceDefinition(
        instance_type=ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE)
    )],
    launch_template=launch_template,
    vpc=vpc,
    vpc_subnets=ec2.SubnetSelection(subnet_type=ec2.SubnetType.PUBLIC)
)

Attributes

auto_scaling_policy

(experimental) Configuration settings to define a scaling policy for the Auto Scaling group that is optimized for game hosting.

The scaling policy uses the metric PercentUtilizedGameServers to maintain a buffer of idle game servers that can immediately accommodate new games and players.

After the Auto Scaling group is created, update this value directly in the Auto Scaling group using the AWS console or APIs.

Default:

no autoscaling policy settled

Stability:

experimental

balancing_strategy

(experimental) Indicates how GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances in the game server group.

Default:

SPOT_PREFERRED

Stability:

experimental

delete_option

(experimental) The type of delete to perform.

To delete a game server group, specify the DeleteOption

Default:

SAFE_DELETE

Stability:

experimental

game_server_group_name

(experimental) A developer-defined identifier for the game server group.

The name is unique for each Region in each AWS account.

Stability:

experimental

instance_definitions

(experimental) The set of Amazon EC2 instance types that GameLift FleetIQ can use when balancing and automatically scaling instances in the corresponding Auto Scaling group.

Stability:

experimental

launch_template

(experimental) The Amazon EC2 launch template that contains configuration settings and game server code to be deployed to all instances in the game server group.

After the Auto Scaling group is created, update this value directly in the Auto Scaling group using the AWS console or APIs.

NOTE: If you specify network interfaces in your launch template, you must explicitly set the property AssociatePublicIpAddress to true. If no network interface is specified in the launch template, GameLift FleetIQ uses your account’s default VPC.

See:

https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html

Stability:

experimental

max_size

(experimental) The maximum number of instances allowed in the Amazon EC2 Auto Scaling group.

During automatic scaling events, GameLift FleetIQ and EC2 do not scale up the group above this maximum.

After the Auto Scaling group is created, update this value directly in the Auto Scaling group using the AWS console or APIs.

Default:

the default is 1

Stability:

experimental

min_size

(experimental) The minimum number of instances allowed in the Amazon EC2 Auto Scaling group.

During automatic scaling events, GameLift FleetIQ and Amazon EC2 do not scale down the group below this minimum.

In production, this value should be set to at least 1.

After the Auto Scaling group is created, update this value directly in the Auto Scaling group using the AWS console or APIs.

Default:

the default is 0

Stability:

experimental

protect_game_server

(experimental) A flag that indicates whether instances in the game server group are protected from early termination.

Unprotected instances that have active game servers running might be terminated during a scale-down event, causing players to be dropped from the game. Protected instances cannot be terminated while there are active game servers running except in the event of a forced game server group deletion.

An exception to this is with Spot Instances, which can be terminated by AWS regardless of protection status.

Default:

game servers running might be terminated during a scale-down event

Stability:

experimental

role

(experimental) The IAM role that allows Amazon GameLift to access your Amazon EC2 Auto Scaling groups.

Default:
  • a role will be created with default trust to Gamelift and Autoscaling service principal with a default policy GameLiftGameServerGroupPolicy attached.

See:

https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-iam-permissions-roles.html

Stability:

experimental

vpc

(experimental) The VPC network to place the game server group in.

By default, all GameLift FleetIQ-supported Availability Zones are used.

You can use this parameter to specify VPCs that you’ve set up.

This property cannot be updated after the game server group is created, and the corresponding Auto Scaling group will always use the property value that is set with this request, even if the Auto Scaling group is updated directly.

Stability:

experimental

vpc_subnets

(experimental) Game server group subnet selection.

Default:

all GameLift FleetIQ-supported Availability Zones are used.

Stability:

experimental