Class CfnGameServerGroup

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-05T03:43:43.982Z") @Stability(Stable) public class CfnGameServerGroup extends CfnResource implements IInspectable, ITaggable
This operation is used with the Amazon GameLift FleetIQ solution and game server groups..

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

GameLift FleetIQ Guide

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:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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 class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrAutoScalingGroupArn

      @Stability(Stable) @NotNull public String getAttrAutoScalingGroupArn()
      A unique identifier for the auto scaling group.
    • getAttrGameServerGroupArn

      @Stability(Stable) @NotNull public String getAttrGameServerGroupArn()
      A unique identifier for the game server group.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getGameServerGroupName

      @Stability(Stable) @NotNull public String getGameServerGroupName()
      A developer-defined identifier for the game server group.
    • setGameServerGroupName

      @Stability(Stable) public void setGameServerGroupName(@NotNull String value)
      A developer-defined identifier for the game server group.
    • getInstanceDefinitions

      @Stability(Stable) @NotNull public Object 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

      @Stability(Stable) public void setInstanceDefinitions(@NotNull IResolvable 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.
    • setInstanceDefinitions

      @Stability(Stable) public void setInstanceDefinitions(@NotNull 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.
    • getRoleArn

      @Stability(Stable) @NotNull public String getRoleArn()
      The Amazon Resource Name ( ARN ) for an IAM role that allows Amazon GameLift to access your Amazon EC2 Auto Scaling groups.
    • setRoleArn

      @Stability(Stable) public void setRoleArn(@NotNull String value)
      The Amazon Resource Name ( ARN ) for an IAM role that allows Amazon GameLift to access your Amazon EC2 Auto Scaling groups.
    • getAutoScalingPolicy

      @Stability(Stable) @Nullable public Object getAutoScalingPolicy()
      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 IResolvable value)
      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

      @Stability(Stable) @Nullable public String getBalancingStrategy()
      Indicates how Amazon GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances in the game server group.
    • setBalancingStrategy

      @Stability(Stable) public void setBalancingStrategy(@Nullable String value)
      Indicates how Amazon GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances in the game server group.
    • getDeleteOption

      @Stability(Stable) @Nullable public String getDeleteOption()
      The type of delete to perform.
    • setDeleteOption

      @Stability(Stable) public void setDeleteOption(@Nullable String value)
      The type of delete to perform.
    • getGameServerProtectionPolicy

      @Stability(Stable) @Nullable public String getGameServerProtectionPolicy()
      A flag that indicates whether instances in the game server group are protected from early termination.
    • setGameServerProtectionPolicy

      @Stability(Stable) public void setGameServerProtectionPolicy(@Nullable String value)
      A flag that indicates whether instances in the game server group are protected from early termination.
    • getLaunchTemplate

      @Stability(Stable) @Nullable public Object 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

      @Stability(Stable) public void setLaunchTemplate(@Nullable 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.
    • 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

      @Stability(Stable) @Nullable public Number getMaxSize()
      The maximum number of instances allowed in the Amazon EC2 Auto Scaling group.
    • setMaxSize

      @Stability(Stable) public void setMaxSize(@Nullable Number value)
      The maximum number of instances allowed in the Amazon EC2 Auto Scaling group.
    • getMinSize

      @Stability(Stable) @Nullable public Number getMinSize()
      The minimum number of instances allowed in the Amazon EC2 Auto Scaling group.
    • setMinSize

      @Stability(Stable) public void setMinSize(@Nullable Number value)
      The minimum number of instances allowed in the Amazon EC2 Auto Scaling group.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      A list of labels to assign to the new game server group resource.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      A list of labels to assign to the new game server group resource.
    • getVpcSubnets

      @Stability(Stable) @Nullable public List<String> getVpcSubnets()
      A list of virtual private cloud (VPC) subnets to use with instances in the game server group.
    • setVpcSubnets

      @Stability(Stable) public void setVpcSubnets(@Nullable List<String> value)
      A list of virtual private cloud (VPC) subnets to use with instances in the game server group.