CfnGameServerGroupProps Struct
Properties for defining a CfnGameServerGroup.
| Source | |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_gamelift as gamelift } from 'aws-cdk-lib';
const cfnGameServerGroupProps: gamelift.CfnGameServerGroupProps = {
gameServerGroupName: 'gameServerGroupName',
instanceDefinitions: [{
instanceType: 'instanceType',
// the properties below are optional
weightedCapacity: 'weightedCapacity',
}],
roleArn: 'roleArn',
// the properties below are optional
autoScalingPolicy: {
targetTrackingConfiguration: {
targetValue: 123,
},
// the properties below are optional
estimatedInstanceWarmup: 123,
},
balancingStrategy: 'balancingStrategy',
deleteOption: 'deleteOption',
gameServerProtectionPolicy: 'gameServerProtectionPolicy',
launchTemplate: {
launchTemplateId: 'launchTemplateId',
launchTemplateName: 'launchTemplateName',
version: 'version',
},
maxSize: 123,
minSize: 123,
tags: [{
key: 'key',
value: 'value',
}],
vpcSubnets: ['vpcSubnets'],
};
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_gamelift as gamelift
cfn_game_server_group_props = gamelift.CfnGameServerGroupProps(
game_server_group_name="gameServerGroupName",
instance_definitions=[gamelift.CfnGameServerGroup.InstanceDefinitionProperty(
instance_type="instanceType",
# the properties below are optional
weighted_capacity="weightedCapacity"
)],
role_arn="roleArn",
# the properties below are optional
auto_scaling_policy=gamelift.CfnGameServerGroup.AutoScalingPolicyProperty(
target_tracking_configuration=gamelift.CfnGameServerGroup.TargetTrackingConfigurationProperty(
target_value=123
),
# the properties below are optional
estimated_instance_warmup=123
),
balancing_strategy="balancingStrategy",
delete_option="deleteOption",
game_server_protection_policy="gameServerProtectionPolicy",
launch_template=gamelift.CfnGameServerGroup.LaunchTemplateProperty(
launch_template_id="launchTemplateId",
launch_template_name="launchTemplateName",
version="version"
),
max_size=123,
min_size=123,
tags=[CfnTag(
key="key",
value="value"
)],
vpc_subnets=["vpcSubnets"]
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.gamelift.*;
CfnGameServerGroupProps cfnGameServerGroupProps = CfnGameServerGroupProps.builder()
.gameServerGroupName("gameServerGroupName")
.instanceDefinitions(List.of(InstanceDefinitionProperty.builder()
.instanceType("instanceType")
// the properties below are optional
.weightedCapacity("weightedCapacity")
.build()))
.roleArn("roleArn")
// the properties below are optional
.autoScalingPolicy(AutoScalingPolicyProperty.builder()
.targetTrackingConfiguration(TargetTrackingConfigurationProperty.builder()
.targetValue(123)
.build())
// the properties below are optional
.estimatedInstanceWarmup(123)
.build())
.balancingStrategy("balancingStrategy")
.deleteOption("deleteOption")
.gameServerProtectionPolicy("gameServerProtectionPolicy")
.launchTemplate(LaunchTemplateProperty.builder()
.launchTemplateId("launchTemplateId")
.launchTemplateName("launchTemplateName")
.version("version")
.build())
.maxSize(123)
.minSize(123)
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.vpcSubnets(List.of("vpcSubnets"))
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.GameLift;
var cfnGameServerGroupProps = new CfnGameServerGroupProps {
GameServerGroupName = "gameServerGroupName",
InstanceDefinitions = new [] { new InstanceDefinitionProperty {
InstanceType = "instanceType",
// the properties below are optional
WeightedCapacity = "weightedCapacity"
} },
RoleArn = "roleArn",
// the properties below are optional
AutoScalingPolicy = new AutoScalingPolicyProperty {
TargetTrackingConfiguration = new TargetTrackingConfigurationProperty {
TargetValue = 123
},
// the properties below are optional
EstimatedInstanceWarmup = 123
},
BalancingStrategy = "balancingStrategy",
DeleteOption = "deleteOption",
GameServerProtectionPolicy = "gameServerProtectionPolicy",
LaunchTemplate = new LaunchTemplateProperty {
LaunchTemplateId = "launchTemplateId",
LaunchTemplateName = "launchTemplateName",
Version = "version"
},
MaxSize = 123,
MinSize = 123,
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
VpcSubnets = new [] { "vpcSubnets" }
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
cfnGameServerGroupProps := &CfnGameServerGroupProps{
GameServerGroupName: jsii.String("gameServerGroupName"),
InstanceDefinitions: []interface{}{
&InstanceDefinitionProperty{
InstanceType: jsii.String("instanceType"),
// the properties below are optional
WeightedCapacity: jsii.String("weightedCapacity"),
},
},
RoleArn: jsii.String("roleArn"),
// the properties below are optional
AutoScalingPolicy: &AutoScalingPolicyProperty{
TargetTrackingConfiguration: &TargetTrackingConfigurationProperty{
TargetValue: jsii.Number(123),
},
// the properties below are optional
EstimatedInstanceWarmup: jsii.Number(123),
},
BalancingStrategy: jsii.String("balancingStrategy"),
DeleteOption: jsii.String("deleteOption"),
GameServerProtectionPolicy: jsii.String("gameServerProtectionPolicy"),
LaunchTemplate: &LaunchTemplateProperty{
LaunchTemplateId: jsii.String("launchTemplateId"),
LaunchTemplateName: jsii.String("launchTemplateName"),
Version: jsii.String("version"),
},
MaxSize: jsii.Number(123),
MinSize: jsii.Number(123),
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
VpcSubnets: []*string{
jsii.String("vpcSubnets"),
},
}
Properties
autoScalingPolicyoptionalIResolvable | CfnGameServerGroup.auto_scaling_policyoptionaltyping.Union[IResolvable, AutoScalingPolicyProperty]autoScalingPolicyoptionalIResolvableAutoScalingPolicyoptionalIResolvableAutoScalingPolicyoptionalinterface{} #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.
balancingStrategyoptionalstringbalancing_strategyoptionalstrbalancingStrategyoptionalStringBalancingStrategyoptionalstringBalancingStrategyoptional*string #notes
Method options include the following:
SPOT_ONLY- Only Spot Instances are used in the game server group. If Spot Instances are unavailable or not viable for game hosting, the game server group provides no hosting capacity until Spot Instances can again be used. Until then, no new instances are started, and the existing nonviable Spot Instances are terminated (after current gameplay ends) and are not replaced.SPOT_PREFERRED- (default value) Spot Instances are used whenever available in the game server group. If Spot Instances are unavailable, the game server group continues to provide hosting capacity by falling back to On-Demand Instances. Existing nonviable Spot Instances are terminated (after current gameplay ends) and are replaced with new On-Demand Instances.ON_DEMAND_ONLY- Only On-Demand Instances are used in the game server group. No Spot Instances are used, even when available, while this balancing strategy is in force.
deleteOptionoptionalstringdelete_optionoptionalstrdeleteOptionoptionalStringDeleteOptionoptionalstringDeleteOptionoptional*string #notes
To delete a game server group, specify the DeleteOption . Options include the following:
SAFE_DELETE– (default) Terminates the game server group and Amazon EC2 Auto Scaling group only when it has no game servers that are inUTILIZEDstatus.FORCE_DELETE– Terminates the game server group, including all active game servers regardless of their utilization status, and the Amazon EC2 Auto Scaling group.RETAIN– Does a safe delete of the game server group but retains the Amazon EC2 Auto Scaling group as is.
gameServerGroupNamestringgame_server_group_namestrgameServerGroupNameStringGameServerGroupNamestringGameServerGroupName*string required #The name is unique for each Region in each AWS account.
gameServerProtectionPolicyoptionalstringgame_server_protection_policyoptionalstrgameServerProtectionPolicyoptionalStringGameServerProtectionPolicyoptionalstringGameServerProtectionPolicyoptional*string #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 (see ). An exception to this is with Spot Instances, which can be terminated by AWS regardless of protection status.
instanceDefinitionsIResolvable | IResolvable | CfnGameServerGroup.instance_definitionstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, InstanceDefinitionProperty]]]instanceDefinitionsIResolvableInstanceDefinitionsIResolvableInstanceDefinitionsinterface{} required #launchTemplateoptionalIResolvable | CfnGameServerGroup.launch_templateoptionaltyping.Union[IResolvable, LaunchTemplateProperty]launchTemplateoptionalIResolvableLaunchTemplateoptionalIResolvableLaunchTemplateoptionalinterface{} #notes
You can specify the template using either the template name or ID. For help with creating a launch template, see Creating a Launch Template for an Auto Scaling Group in the Amazon Elastic Compute Cloud Auto Scaling User Guide . After the Auto Scaling group is created, update this value directly in the Auto Scaling group using the AWS console or APIs.
If you specify network interfaces in your launch template, you must explicitly set the property
AssociatePublicIpAddressto "true". If no network interface is specified in the launch template, Amazon GameLift Servers FleetIQ uses your account's default VPC.
maxSizeoptionalnumbermax_sizeoptionalint | floatmaxSizeoptionalNumberMaxSizeoptionaldoubleMaxSizeoptional*float64 #notes
During automatic scaling events, Amazon GameLift Servers 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 #notes
During automatic scaling events, Amazon GameLift Servers 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.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #notes
Tags are developer-defined key-value pairs. Tagging AWS resources is useful for resource management, access management, and cost allocation. For more information, see Tagging AWS Resources in the AWS General Reference . Once the resource is created, you can use TagResource, UntagResource, and ListTagsForResource to add, remove, and view tags, respectively. The maximum tag limit may be lower than stated. See the AWS General Reference for actual tagging limits.
vpcSubnetsoptionalstring[]vpc_subnetsoptionaltyping.List[str]vpcSubnetsoptionalList<String>VpcSubnetsoptionalstring[]VpcSubnetsoptional*[]*string #notes
By default, all Amazon GameLift Servers 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.