CfnGameServerGroupPropsMixin

class aws_cdk.mixins_preview.aws_gamelift.mixins.CfnGameServerGroupPropsMixin(props, *, strategy=None)

Bases: Mixin

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-gameservergroup.html

CloudformationResource:

AWS::GameLift::GameServerGroup

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_gamelift import mixins as gamelift_mixins

cfn_game_server_group_props_mixin = gamelift_mixins.CfnGameServerGroupPropsMixin(gamelift_mixins.CfnGameServerGroupMixinProps(
    auto_scaling_policy=gamelift_mixins.CfnGameServerGroupPropsMixin.AutoScalingPolicyProperty(
        estimated_instance_warmup=123,
        target_tracking_configuration=gamelift_mixins.CfnGameServerGroupPropsMixin.TargetTrackingConfigurationProperty(
            target_value=123
        )
    ),
    balancing_strategy="balancingStrategy",
    delete_option="deleteOption",
    game_server_group_name="gameServerGroupName",
    game_server_protection_policy="gameServerProtectionPolicy",
    instance_definitions=[gamelift_mixins.CfnGameServerGroupPropsMixin.InstanceDefinitionProperty(
        instance_type="instanceType",
        weighted_capacity="weightedCapacity"
    )],
    launch_template=gamelift_mixins.CfnGameServerGroupPropsMixin.LaunchTemplateProperty(
        launch_template_id="launchTemplateId",
        launch_template_name="launchTemplateName",
        version="version"
    ),
    max_size=123,
    min_size=123,
    role_arn="roleArn",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    vpc_subnets=["vpcSubnets"]
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::GameLift::GameServerGroup.

Parameters:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['autoScalingPolicy', 'balancingStrategy', 'deleteOption', 'gameServerGroupName', 'gameServerProtectionPolicy', 'instanceDefinitions', 'launchTemplate', 'maxSize', 'minSize', 'roleArn', 'tags', 'vpcSubnets']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

AutoScalingPolicyProperty

class CfnGameServerGroupPropsMixin.AutoScalingPolicyProperty(*, estimated_instance_warmup=None, target_tracking_configuration=None)

Bases: object

This data type is used with the GameLift FleetIQ and game server groups..

Configuration settings for intelligent automatic scaling that uses target tracking. After the Auto Scaling group is created, all updates to Auto Scaling policies, including changing this policy and adding or removing other policies, is done directly on the Auto Scaling group.

Parameters:
  • estimated_instance_warmup (Union[int, float, None]) – Length of time, in seconds, it takes for a new instance to start new game server processes and register with Amazon GameLift Servers FleetIQ. Specifying a warm-up time can be useful, particularly with game servers that take a long time to start up, because it avoids prematurely starting new instances.

  • target_tracking_configuration (Union[IResolvable, TargetTrackingConfigurationProperty, Dict[str, Any], None]) – Settings for a target-based scaling policy applied to Auto Scaling group. These settings are used to create a target-based policy that tracks the GameLift FleetIQ metric PercentUtilizedGameServers and specifies a target value for the metric. As player usage changes, the policy triggers to adjust the game server group capacity so that the metric returns to the target value.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-autoscalingpolicy.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_gamelift import mixins as gamelift_mixins

auto_scaling_policy_property = gamelift_mixins.CfnGameServerGroupPropsMixin.AutoScalingPolicyProperty(
    estimated_instance_warmup=123,
    target_tracking_configuration=gamelift_mixins.CfnGameServerGroupPropsMixin.TargetTrackingConfigurationProperty(
        target_value=123
    )
)

Attributes

estimated_instance_warmup

Length of time, in seconds, it takes for a new instance to start new game server processes and register with Amazon GameLift Servers FleetIQ.

Specifying a warm-up time can be useful, particularly with game servers that take a long time to start up, because it avoids prematurely starting new instances.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-autoscalingpolicy.html#cfn-gamelift-gameservergroup-autoscalingpolicy-estimatedinstancewarmup

target_tracking_configuration

Settings for a target-based scaling policy applied to Auto Scaling group.

These settings are used to create a target-based policy that tracks the GameLift FleetIQ metric PercentUtilizedGameServers and specifies a target value for the metric. As player usage changes, the policy triggers to adjust the game server group capacity so that the metric returns to the target value.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-autoscalingpolicy.html#cfn-gamelift-gameservergroup-autoscalingpolicy-targettrackingconfiguration

InstanceDefinitionProperty

class CfnGameServerGroupPropsMixin.InstanceDefinitionProperty(*, instance_type=None, weighted_capacity=None)

Bases: object

This data type is used with the Amazon GameLift FleetIQ and game server groups..

An allowed instance type for a GameServerGroup . All game server groups must have at least two instance types defined for it. GameLift FleetIQ periodically evaluates each defined instance type for viability. It then updates the Auto Scaling group with the list of viable instance types.

Parameters:
  • instance_type (Optional[str]) – An Amazon EC2 instance type designation.

  • weighted_capacity (Optional[str]) – Instance weighting that indicates how much this instance type contributes to the total capacity of a game server group. Instance weights are used by Amazon GameLift Servers FleetIQ to calculate the instance type’s cost per unit hour and better identify the most cost-effective options. For detailed information on weighting instance capacity, see Instance Weighting in the Amazon Elastic Compute Cloud Auto Scaling User Guide . Default value is “1”.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-instancedefinition.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_gamelift import mixins as gamelift_mixins

instance_definition_property = gamelift_mixins.CfnGameServerGroupPropsMixin.InstanceDefinitionProperty(
    instance_type="instanceType",
    weighted_capacity="weightedCapacity"
)

Attributes

instance_type

An Amazon EC2 instance type designation.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-instancedefinition.html#cfn-gamelift-gameservergroup-instancedefinition-instancetype

weighted_capacity

Instance weighting that indicates how much this instance type contributes to the total capacity of a game server group.

Instance weights are used by Amazon GameLift Servers FleetIQ to calculate the instance type’s cost per unit hour and better identify the most cost-effective options. For detailed information on weighting instance capacity, see Instance Weighting in the Amazon Elastic Compute Cloud Auto Scaling User Guide . Default value is “1”.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-instancedefinition.html#cfn-gamelift-gameservergroup-instancedefinition-weightedcapacity

LaunchTemplateProperty

class CfnGameServerGroupPropsMixin.LaunchTemplateProperty(*, launch_template_id=None, launch_template_name=None, version=None)

Bases: object

This data type is used with the GameLift FleetIQ and game server groups..

An Amazon EC2 launch template that contains configuration settings and game server code to be deployed to all instances in a game server group. The launch template is specified when creating a new game server group with GameServerGroup .

Parameters:
  • launch_template_id (Optional[str]) – A unique identifier for an existing Amazon EC2 launch template.

  • launch_template_name (Optional[str]) – A readable identifier for an existing Amazon EC2 launch template.

  • version (Optional[str]) – The version of the Amazon EC2 launch template to use. If no version is specified, the default version will be used. With Amazon EC2, you can specify a default version for a launch template. If none is set, the default is the first version created.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-launchtemplate.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_gamelift import mixins as gamelift_mixins

launch_template_property = gamelift_mixins.CfnGameServerGroupPropsMixin.LaunchTemplateProperty(
    launch_template_id="launchTemplateId",
    launch_template_name="launchTemplateName",
    version="version"
)

Attributes

launch_template_id

A unique identifier for an existing Amazon EC2 launch template.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-launchtemplate.html#cfn-gamelift-gameservergroup-launchtemplate-launchtemplateid

launch_template_name

A readable identifier for an existing Amazon EC2 launch template.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-launchtemplate.html#cfn-gamelift-gameservergroup-launchtemplate-launchtemplatename

version

The version of the Amazon EC2 launch template to use.

If no version is specified, the default version will be used. With Amazon EC2, you can specify a default version for a launch template. If none is set, the default is the first version created.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-launchtemplate.html#cfn-gamelift-gameservergroup-launchtemplate-version

TargetTrackingConfigurationProperty

class CfnGameServerGroupPropsMixin.TargetTrackingConfigurationProperty(*, target_value=None)

Bases: object

This data type is used with the Amazon GameLift FleetIQ and game server groups..

Settings for a target-based scaling policy as part of a GameServerGroupAutoScalingPolicy . These settings are used to create a target-based policy that tracks the GameLift FleetIQ metric "PercentUtilizedGameServers" and specifies a target value for the metric. As player usage changes, the policy triggers to adjust the game server group capacity so that the metric returns to the target value.

Parameters:

target_value (Union[int, float, None]) – Desired value to use with a game server group target-based scaling policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-targettrackingconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_gamelift import mixins as gamelift_mixins

target_tracking_configuration_property = gamelift_mixins.CfnGameServerGroupPropsMixin.TargetTrackingConfigurationProperty(
    target_value=123
)

Attributes

target_value

Desired value to use with a game server group target-based scaling policy.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-gamelift-gameservergroup-targettrackingconfiguration.html#cfn-gamelift-gameservergroup-targettrackingconfiguration-targetvalue