Class GameServerGroup
- All Implemented Interfaces:
IResource
,IGameServerGroup
,IGrantable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
(experimental) A fluent builder forGameServerGroup
.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.gamelift.alpha.IGameServerGroup
IGameServerGroup.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
GameServerGroup
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
GameServerGroup
(software.amazon.jsii.JsiiObjectRef objRef) GameServerGroup
(software.constructs.Construct scope, String id, GameServerGroupProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IGameServerGroup
fromGameServerGroupAttributes
(software.constructs.Construct scope, String id, GameServerGroupAttributes attrs) (experimental) Import an existing game server group from its attributes.(experimental) The ARN of the generated AutoScaling group.(experimental) The ARN of the game server group.(experimental) The name of the game server group.(experimental) The principal this GameLift game server group is using.getRole()
(experimental) The IAM role that allows Amazon GameLift to access your Amazon EC2 Auto Scaling groups.getVpc()
(experimental) The VPC network to place the game server group in.(experimental) The game server group's subnets.Methods inherited from class software.amazon.awscdk.services.gamelift.alpha.GameServerGroupBase
grant, metric, metric
Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
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
-
fromGameServerGroupAttributes
@Stability(Experimental) @NotNull public static IGameServerGroup fromGameServerGroupAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull GameServerGroupAttributes attrs) (experimental) Import an existing game server group from its attributes.- Parameters:
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.
-
parseAutoScalingPolicy
@Stability(Experimental) @Nullable protected CfnGameServerGroup.AutoScalingPolicyProperty parseAutoScalingPolicy(@NotNull GameServerGroupProps props) - Parameters:
props
- This parameter is required.
-
parseInstanceDefinitions
@Stability(Experimental) @NotNull protected List<CfnGameServerGroup.InstanceDefinitionProperty> parseInstanceDefinitions(@NotNull GameServerGroupProps props) - Parameters:
props
- This parameter is required.
-
parseLaunchTemplate
@Stability(Experimental) @NotNull protected CfnGameServerGroup.LaunchTemplateProperty parseLaunchTemplate(@NotNull GameServerGroupProps props) - Parameters:
props
- This parameter is required.
-
getAutoScalingGroupArn
(experimental) The ARN of the generated AutoScaling group.- Specified by:
getAutoScalingGroupArn
in interfaceIGameServerGroup
- Specified by:
getAutoScalingGroupArn
in classGameServerGroupBase
-
getGameServerGroupArn
(experimental) The ARN of the game server group.- Specified by:
getGameServerGroupArn
in interfaceIGameServerGroup
- Specified by:
getGameServerGroupArn
in classGameServerGroupBase
-
getGameServerGroupName
(experimental) The name of the game server group.- Specified by:
getGameServerGroupName
in interfaceIGameServerGroup
- Specified by:
getGameServerGroupName
in classGameServerGroupBase
-
getGrantPrincipal
(experimental) The principal this GameLift game server group is using.- Specified by:
getGrantPrincipal
in interfaceIGrantable
- Specified by:
getGrantPrincipal
in classGameServerGroupBase
-
getRole
(experimental) The IAM role that allows Amazon GameLift to access your Amazon EC2 Auto Scaling groups. -
getVpc
(experimental) The VPC network to place the game server group in. -
getVpcSubnets
(experimental) The game server group's subnets.
-