Class CfnGameServerGroup
- All Implemented Interfaces:
IInspectable
,ITaggable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
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. For more information, see Launching an Instance from a Launch Template in the Amazon EC2 User Guide .
- An IAM role that extends limited access to your AWS account to allow GameLift FleetIQ to create and interact with the Auto Scaling group. For more information, see Create IAM roles for cross-service interaction in the GameLift FleetIQ Developer Guide .
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.
Learn more
Example:
// 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.*; CfnGameServerGroup cfnGameServerGroup = CfnGameServerGroup.Builder.create(this, "MyCfnGameServerGroup") .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();
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
This data type is used with the GameLift FleetIQ and game server groups..static final class
A fluent builder forCfnGameServerGroup
.static interface
This data type is used with the Amazon GameLift FleetIQ and game server groups..static interface
This data type is used with the GameLift FleetIQ and game server groups..static interface
This data type is used with the Amazon GameLift FleetIQ and game server groups..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.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnGameServerGroup
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnGameServerGroup
(software.amazon.jsii.JsiiObjectRef objRef) CfnGameServerGroup
(software.constructs.Construct scope, String id, CfnGameServerGroupProps props) -
Method Summary
Modifier and TypeMethodDescriptionA unique identifier for the auto scaling group.A unique identifier for the game server group.Configuration settings to define a scaling policy for the Auto Scaling group that is optimized for game hosting.Indicates how Amazon GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances in the game server group.The type of delete to perform.A developer-defined identifier for the game server group.A flag that indicates whether instances in the game server group are protected from early termination.The set of Amazon EC2 instance types that Amazon GameLift FleetIQ can use when balancing and automatically scaling instances in the corresponding Auto Scaling group.The Amazon EC2 launch template that contains configuration settings and game server code to be deployed to all instances in the game server group.The maximum number of instances allowed in the Amazon EC2 Auto Scaling group.The minimum number of instances allowed in the Amazon EC2 Auto Scaling group.The Amazon Resource Name ( ARN ) for an IAM role that allows Amazon GameLift to access your Amazon EC2 Auto Scaling groups.getTags()
Tag Manager which manages the tags for this resource.A list of labels to assign to the new game server group resource.A list of virtual private cloud (VPC) subnets to use with instances in the game server group.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setAutoScalingPolicy
(IResolvable value) Configuration settings to define a scaling policy for the Auto Scaling group that is optimized for game hosting.void
Configuration settings to define a scaling policy for the Auto Scaling group that is optimized for game hosting.void
setBalancingStrategy
(String value) Indicates how Amazon GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances in the game server group.void
setDeleteOption
(String value) The type of delete to perform.void
setGameServerGroupName
(String value) A developer-defined identifier for the game server group.void
A flag that indicates whether instances in the game server group are protected from early termination.void
setInstanceDefinitions
(List<Object> value) The set of Amazon EC2 instance types that Amazon GameLift FleetIQ can use when balancing and automatically scaling instances in the corresponding Auto Scaling group.void
The set of Amazon EC2 instance types that Amazon GameLift FleetIQ can use when balancing and automatically scaling instances in the corresponding Auto Scaling group.void
setLaunchTemplate
(IResolvable value) The Amazon EC2 launch template that contains configuration settings and game server code to be deployed to all instances in the game server group.void
The Amazon EC2 launch template that contains configuration settings and game server code to be deployed to all instances in the game server group.void
setMaxSize
(Number value) The maximum number of instances allowed in the Amazon EC2 Auto Scaling group.void
setMinSize
(Number value) The minimum number of instances allowed in the Amazon EC2 Auto Scaling group.void
setRoleArn
(String value) The Amazon Resource Name ( ARN ) for an IAM role that allows Amazon GameLift to access your Amazon EC2 Auto Scaling groups.void
setTagsRaw
(List<CfnTag> value) A list of labels to assign to the new game server group resource.void
setVpcSubnets
(List<String> value) A list of virtual private cloud (VPC) subnets to use with instances in the game server group.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
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.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnGameServerGroup
protected CfnGameServerGroup(software.amazon.jsii.JsiiObjectRef objRef) -
CfnGameServerGroup
protected CfnGameServerGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnGameServerGroup
@Stability(Stable) public CfnGameServerGroup(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnGameServerGroupProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrAutoScalingGroupArn
A unique identifier for the auto scaling group. -
getAttrGameServerGroupArn
A unique identifier for the game server group. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getGameServerGroupName
A developer-defined identifier for the game server group. -
setGameServerGroupName
A developer-defined identifier for the game server group. -
getInstanceDefinitions
The set of Amazon EC2 instance types that Amazon GameLift FleetIQ can use when balancing and automatically scaling instances in the corresponding Auto Scaling group. -
setInstanceDefinitions
The set of Amazon EC2 instance types that Amazon GameLift FleetIQ can use when balancing and automatically scaling instances in the corresponding Auto Scaling group. -
setInstanceDefinitions
The set of Amazon EC2 instance types that Amazon GameLift FleetIQ can use when balancing and automatically scaling instances in the corresponding Auto Scaling group. -
getRoleArn
The Amazon Resource Name ( ARN ) for an IAM role that allows Amazon GameLift to access your Amazon EC2 Auto Scaling groups. -
setRoleArn
The Amazon Resource Name ( ARN ) for an IAM role that allows Amazon GameLift to access your Amazon EC2 Auto Scaling groups. -
getAutoScalingPolicy
Configuration settings to define a scaling policy for the Auto Scaling group that is optimized for game hosting. -
setAutoScalingPolicy
Configuration settings to define a scaling policy for the Auto Scaling group that is optimized for game hosting. -
setAutoScalingPolicy
@Stability(Stable) public void setAutoScalingPolicy(@Nullable CfnGameServerGroup.AutoScalingPolicyProperty value) Configuration settings to define a scaling policy for the Auto Scaling group that is optimized for game hosting. -
getBalancingStrategy
Indicates how Amazon GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances in the game server group. -
setBalancingStrategy
Indicates how Amazon GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances in the game server group. -
getDeleteOption
The type of delete to perform. -
setDeleteOption
The type of delete to perform. -
getGameServerProtectionPolicy
A flag that indicates whether instances in the game server group are protected from early termination. -
setGameServerProtectionPolicy
A flag that indicates whether instances in the game server group are protected from early termination. -
getLaunchTemplate
The Amazon EC2 launch template that contains configuration settings and game server code to be deployed to all instances in the game server group. -
setLaunchTemplate
The Amazon EC2 launch template that contains configuration settings and game server code to be deployed to all instances in the game server group. -
setLaunchTemplate
@Stability(Stable) public void setLaunchTemplate(@Nullable CfnGameServerGroup.LaunchTemplateProperty value) The Amazon EC2 launch template that contains configuration settings and game server code to be deployed to all instances in the game server group. -
getMaxSize
The maximum number of instances allowed in the Amazon EC2 Auto Scaling group. -
setMaxSize
The maximum number of instances allowed in the Amazon EC2 Auto Scaling group. -
getMinSize
The minimum number of instances allowed in the Amazon EC2 Auto Scaling group. -
setMinSize
The minimum number of instances allowed in the Amazon EC2 Auto Scaling group. -
getTagsRaw
A list of labels to assign to the new game server group resource. -
setTagsRaw
A list of labels to assign to the new game server group resource. -
getVpcSubnets
A list of virtual private cloud (VPC) subnets to use with instances in the game server group. -
setVpcSubnets
A list of virtual private cloud (VPC) subnets to use with instances in the game server group.
-