Experimental
@aws-cdk/aws-gamelift-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
GameServerGroupProps Struct
Properties for a new Gamelift FleetIQ Game server group.
Example
declare const launchTemplate: ec2.ILaunchTemplate;
declare const vpc: ec2.IVpc;
new gamelift.GameServerGroup(this, 'GameServerGroup', {
gameServerGroupName: 'sample-gameservergroup-name',
instanceDefinitions: [{
instanceType: ec2.InstanceType.of(ec2.InstanceClass.C5, ec2.InstanceSize.LARGE),
},
{
instanceType: ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE),
}],
launchTemplate: launchTemplate,
vpc: vpc,
vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC }
});
# 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)
)
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();
// Install: dotnet add package Amazon.CDK.AWS.GameLift.Alpha
ILaunchTemplate launchTemplate;
IVpc vpc;
new GameServerGroup(this, "GameServerGroup", new GameServerGroupProps {
GameServerGroupName = "sample-gameservergroup-name",
InstanceDefinitions = new [] { new InstanceDefinition {
InstanceType = InstanceType.Of(InstanceClass.C5, InstanceSize.LARGE)
}, new InstanceDefinition {
InstanceType = InstanceType.Of(InstanceClass.C4, InstanceSize.LARGE)
} },
LaunchTemplate = launchTemplate,
Vpc = vpc,
VpcSubnets = new SubnetSelection { SubnetType = SubnetType.PUBLIC }
});
// Install: go get github.com/aws/aws-cdk-go/awscdkgameliftalpha/v2
var launchTemplate ILaunchTemplate
var vpc IVpc
gamelift.NewGameServerGroup(this, jsii.String("GameServerGroup"), &GameServerGroupProps{
GameServerGroupName: jsii.String("sample-gameservergroup-name"),
InstanceDefinitions: []InstanceDefinition{
&InstanceDefinition{
InstanceType: ec2.InstanceType_Of(ec2.InstanceClass_C5, ec2.InstanceSize_LARGE),
},
&InstanceDefinition{
InstanceType: ec2.InstanceType_*Of(ec2.InstanceClass_C4, ec2.InstanceSize_LARGE),
},
},
LaunchTemplate: launchTemplate,
Vpc: vpc,
VpcSubnets: &SubnetSelection{
SubnetType: ec2.SubnetType_PUBLIC,
},
})
Properties
autoScalingPolicyoptionalAutoScalingPolicyauto_scaling_policyoptionalAutoScalingPolicyautoScalingPolicyoptionalAutoScalingPolicyAutoScalingPolicyoptionalAutoScalingPolicyAutoScalingPolicyoptionalAutoScalingPolicy#Default: no autoscaling policy settled
notes
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.
balancingStrategyoptionalBalancingStrategybalancing_strategyoptionalBalancingStrategybalancingStrategyoptionalBalancingStrategyBalancingStrategyoptionalBalancingStrategyBalancingStrategyoptionalBalancingStrategy= SPOT_PREFERRED#deleteOptionoptionalDeleteOptiondelete_optionoptionalDeleteOptiondeleteOptionoptionalDeleteOptionDeleteOptionoptionalDeleteOptionDeleteOptionoptionalDeleteOption= SAFE_DELETE#To delete a game server group, specify the DeleteOption
gameServerGroupNamestringgame_server_group_namestrgameServerGroupNameStringGameServerGroupNamestringGameServerGroupName*stringrequired#The name is unique for each Region in each AWS account.
instanceDefinitionsInstanceDefinition[]instance_definitionstyping.List[InstanceDefinition]instanceDefinitionsList<InstanceDefinition>InstanceDefinitionsInstanceDefinition[]InstanceDefinitions*[]InstanceDefinitionrequired#launchTemplateILaunchTemplatelaunch_templateILaunchTemplatelaunchTemplateILaunchTemplateLaunchTemplateILaunchTemplateLaunchTemplateILaunchTemplaterequired#notes
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.
maxSizeoptionalnumbermax_sizeoptionalint | floatmaxSizeoptionalNumberMaxSizeoptionaldoubleMaxSizeoptional*float64#Default: the default is 1
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.
minSizeoptionalnumbermin_sizeoptionalint | floatminSizeoptionalNumberMinSizeoptionaldoubleMinSizeoptional*float64#Default: the default is 0
notes
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.
protectGameServeroptionalbooleanprotect_game_serveroptionalboolprotectGameServeroptionalBooleanProtectGameServeroptionalboolProtectGameServeroptional*bool#Default: game servers running might be terminated during a scale-down event
notes
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: a role will be created with default trust to Gamelift and Autoscaling service principal with a default policy GameLiftGameServerGroupPolicy attached.
notes
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.
vpcSubnetsoptionalSubnetSelectionvpc_subnetsoptionalSubnetSelectionvpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelection#Default: all GameLift FleetIQ-supported Availability Zones are used.