Experimental
@aws-cdk/aws-gamelift-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
LocationCapacity Struct
Current resource capacity settings in a specified fleet or location.
The location value might refer to a fleet's remote location or its home Region.
| Stability | Experimental |
|---|---|
| Source | lib/fleet-base.ts |
Example
ts
declare const build: gamelift.Build;
// Locations can be added directly through constructor
const fleet = new gamelift.BuildFleet(this, 'Game server fleet', {
fleetName: 'test-fleet',
content: build,
instanceType: ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE),
runtimeConfiguration: {
serverProcesses: [{
launchPath: '/local/game/GameLiftExampleServer.x86_64',
}]
},
locations: [ {
region: 'eu-west-1',
capacity: {
desiredCapacity: 5,
minSize: 2,
maxSize: 10
}
}, {
region: 'us-east-1',
capacity: {
desiredCapacity: 5,
minSize: 2,
maxSize: 10
}
}]
});
// Or through dedicated methods
fleet.addLocation('ap-southeast-1', 5, 2, 10);
python
# build: gamelift.Build
# Locations can be added directly through constructor
fleet = gamelift.BuildFleet(self, "Game server fleet",
fleet_name="test-fleet",
content=build,
instance_type=ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE),
runtime_configuration=gamelift.RuntimeConfiguration(
server_processes=[gamelift.ServerProcess(
launch_path="/local/game/GameLiftExampleServer.x86_64"
)]
),
locations=[gamelift.Location(
region="eu-west-1",
capacity=gamelift.LocationCapacity(
desired_capacity=5,
min_size=2,
max_size=10
)
), gamelift.Location(
region="us-east-1",
capacity=gamelift.LocationCapacity(
desired_capacity=5,
min_size=2,
max_size=10
)
)]
)
# Or through dedicated methods
fleet.add_location("ap-southeast-1", 5, 2, 10)
java
Build build;
// Locations can be added directly through constructor
BuildFleet fleet = BuildFleet.Builder.create(this, "Game server fleet")
.fleetName("test-fleet")
.content(build)
.instanceType(InstanceType.of(InstanceClass.C4, InstanceSize.LARGE))
.runtimeConfiguration(RuntimeConfiguration.builder()
.serverProcesses(List.of(ServerProcess.builder()
.launchPath("/local/game/GameLiftExampleServer.x86_64")
.build()))
.build())
.locations(List.of(Location.builder()
.region("eu-west-1")
.capacity(LocationCapacity.builder()
.desiredCapacity(5)
.minSize(2)
.maxSize(10)
.build())
.build(), Location.builder()
.region("us-east-1")
.capacity(LocationCapacity.builder()
.desiredCapacity(5)
.minSize(2)
.maxSize(10)
.build())
.build()))
.build();
// Or through dedicated methods
fleet.addLocation("ap-southeast-1", 5, 2, 10);
csharp
// Install: dotnet add package Amazon.CDK.AWS.GameLift.Alpha
Build build;
// Locations can be added directly through constructor
var fleet = new BuildFleet(this, "Game server fleet", new BuildFleetProps {
FleetName = "test-fleet",
Content = build,
InstanceType = InstanceType.Of(InstanceClass.C4, InstanceSize.LARGE),
RuntimeConfiguration = new RuntimeConfiguration {
ServerProcesses = new [] { new ServerProcess {
LaunchPath = "/local/game/GameLiftExampleServer.x86_64"
} }
},
Locations = new [] { new Location {
Region = "eu-west-1",
Capacity = new LocationCapacity {
DesiredCapacity = 5,
MinSize = 2,
MaxSize = 10
}
}, new Location {
Region = "us-east-1",
Capacity = new LocationCapacity {
DesiredCapacity = 5,
MinSize = 2,
MaxSize = 10
}
} }
});
// Or through dedicated methods
fleet.AddLocation("ap-southeast-1", 5, 2, 10);
go
// Install: go get github.com/aws/aws-cdk-go/awscdkgameliftalpha/v2
var build Build
// Locations can be added directly through constructor
fleet := gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &BuildFleetProps{
FleetName: jsii.String("test-fleet"),
Content: build,
InstanceType: ec2.InstanceType_Of(ec2.InstanceClass_C4, ec2.InstanceSize_LARGE),
RuntimeConfiguration: &RuntimeConfiguration{
ServerProcesses: []ServerProcess{
&ServerProcess{
LaunchPath: jsii.String("/local/game/GameLiftExampleServer.x86_64"),
},
},
},
Locations: []Location{
&Location{
Region: jsii.String("eu-west-1"),
Capacity: &LocationCapacity{
DesiredCapacity: jsii.Number(5),
MinSize: jsii.Number(2),
MaxSize: jsii.Number(10),
},
},
&Location{
Region: jsii.String("us-east-1"),
Capacity: &LocationCapacity{
DesiredCapacity: jsii.Number(5),
MinSize: jsii.Number(2),
MaxSize: jsii.Number(10),
},
},
},
})
// Or through dedicated methods
fleet.AddLocation(jsii.String("ap-southeast-1"), jsii.Number(5), jsii.Number(2), jsii.Number(10))
Properties
desiredCapacityoptionalnumberdesired_capacityoptionalint | floatdesiredCapacityoptionalNumberDesiredCapacityoptionaldoubleDesiredCapacityoptional*float64 = 0 #The number of Amazon EC2 instances you want to maintain in the specified fleet location.
This value must fall between the minimum and maximum size limits.
maxSizeoptionalnumbermax_sizeoptionalint | floatmaxSizeoptionalNumberMaxSizeoptionaldoubleMaxSizeoptional*float64 = 1 #The maximum number of instances that are allowed in the specified fleet location.
minSizeoptionalnumbermin_sizeoptionalint | floatminSizeoptionalNumberMinSizeoptionaldoubleMinSizeoptional*float64 = 0 #The minimum number of instances that are allowed in the specified fleet location.