Experimental
@aws-cdk/aws-gamelift-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
InstanceDefinition Struct
An allowed instance type for a game server group.
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.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as gamelift_alpha from '@aws-cdk/aws-gamelift-alpha';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
declare const instanceType: ec2.InstanceType;
const instanceDefinition: gamelift_alpha.InstanceDefinition = {
instanceType: instanceType,
// the properties below are optional
weight: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_gamelift_alpha as gamelift_alpha
from aws_cdk import aws_ec2 as ec2
# instance_type: ec2.InstanceType
instance_definition = gamelift_alpha.InstanceDefinition(
instance_type=instance_type,
# the properties below are optional
weight=123
)
java
// 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.alpha.*;
import software.amazon.awscdk.services.ec2.*;
InstanceType instanceType;
InstanceDefinition instanceDefinition = InstanceDefinition.builder()
.instanceType(instanceType)
// the properties below are optional
.weight(123)
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.GameLift.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.GameLift.Alpha;
using Amazon.CDK.AWS.EC2;
InstanceType instanceType;
var instanceDefinition = new InstanceDefinition {
InstanceType = instanceType,
// the properties below are optional
Weight = 123
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdkgameliftalpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"
import "github.com/aws/aws-cdk-go/awscdk"
var instanceType InstanceType
instanceDefinition := &InstanceDefinition{
InstanceType: instanceType,
// the properties below are optional
Weight: jsii.Number(123),
}
Properties
instanceTypeInstanceTypeinstance_typeInstanceTypeinstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceTyperequired#An Amazon EC2 instance type designation.
weightoptionalnumberweightoptionalint | floatweightoptionalNumberWeightoptionaldoubleWeightoptional*float64#Instance weighting that indicates how much this instance type contributes to the total capacity of a game server group.
Default: default value is 1
Instance weights are used by GameLift FleetIQ to calculate the instance type's cost per unit hour and better identify the most cost-effective options.