Experimental
@aws-cdk/aws-gamelift-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
BuildFleetProps Struct
Properties for a new Gamelift build fleet.
| Stability | Experimental |
|---|---|
| Source | lib/build-fleet.ts |
Example
declare const build: gamelift.Build;
// Server processes can be delcared in a declarative way through the 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',
parameters: '-logFile /local/game/logs/myserver1935.log -port 1935',
concurrentExecutions: 100,
}]
}
});
# build: gamelift.Build
# Server processes can be delcared in a declarative way through the 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",
parameters="-logFile /local/game/logs/myserver1935.log -port 1935",
concurrent_executions=100
)]
)
)
Build build;
// Server processes can be delcared in a declarative way through the 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")
.parameters("-logFile /local/game/logs/myserver1935.log -port 1935")
.concurrentExecutions(100)
.build()))
.build())
.build();
// Install: dotnet add package Amazon.CDK.AWS.GameLift.Alpha
Build build;
// Server processes can be delcared in a declarative way through the 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",
Parameters = "-logFile /local/game/logs/myserver1935.log -port 1935",
ConcurrentExecutions = 100
} }
}
});
// Install: go get github.com/aws/aws-cdk-go/awscdkgameliftalpha/v2
var build Build
// Server processes can be delcared in a declarative way through the 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"),
Parameters: jsii.String("-logFile /local/game/logs/myserver1935.log -port 1935"),
ConcurrentExecutions: jsii.Number(100),
},
},
},
})
Properties
The build must have been successfully uploaded to Amazon GameLift and be in a READY status.
This fleet setting cannot be changed once the fleet is created.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #Default: no description is provided
desiredCapacityoptionalnumberdesired_capacityoptionalint | floatdesiredCapacityoptionalNumberDesiredCapacityoptionaldoubleDesiredCapacityoptional*float64 #Default: Default capacity is 0
When creating a new fleet, GameLift automatically sets this value to "1" and initiates a single instance. Once the fleet is active, update this value to trigger GameLift to add or remove instances from the fleet.
Fleet names do not need to be unique.
ingressRulesoptionalIngressRule[]ingress_rulesoptionaltyping.List[IngressRule]ingressRulesoptionalList<IngressRule>IngressRulesoptionalIngressRule[]IngressRulesoptional*[]IngressRule #Default: no inbound traffic allowed
This property must be set before players can connect to game sessions.
instanceTypeInstanceTypeinstance_typeInstanceTypeinstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceType required #Instance type determines the computing resources that will be used to host your game servers, including CPU, memory, storage, and networking capacity.
locationsoptionalLocation[]locationsoptionaltyping.List[Location]locationsoptionalList<Location>LocationsoptionalLocation[]Locationsoptional*[]Location #Default: Create a fleet with instances in the home region only
notes
This parameter can only be used when creating fleets in AWS Regions that support multiple locations. You can add any GameLift-supported AWS Region as a remote location, in the form of an AWS Region code such as us-west-2. To create a fleet with instances in the home region only, omit this parameter.
maxSizeoptionalnumbermax_sizeoptionalint | floatmaxSizeoptionalNumberMaxSizeoptionaldoubleMaxSizeoptional*float64 = 1 #metricGroupoptionalstringmetric_groupoptionalstrmetricGroupoptionalStringMetricGroupoptionalstringMetricGroupoptional*string #Default: Fleet metrics are aggregated with other fleets in the default metric group
A metric group is used to aggregate the metrics for multiple fleets. You can specify an existing metric group name or set a new name to create a new metric group. A fleet can be included in only one metric group at a time.
minSizeoptionalnumbermin_sizeoptionalint | floatminSizeoptionalNumberMinSizeoptionaldoubleMinSizeoptional*float64 = 0 #Default: no vpc peering
notes
Use Amazon Virtual Private Cloud (VPC) peering connections to enable your game servers to communicate directly and privately with your other AWS resources, such as a web service or a repository. You can establish VPC peering with any resources that run on AWS and are managed by an AWS account that you have access to. The VPC must be in the same Region as your fleet.
Warning: Be sure to create a VPC Peering authorization through Gamelift Service API.
protectNewGameSessionoptionalbooleanprotect_new_game_sessionoptionalboolprotectNewGameSessionoptionalBooleanProtectNewGameSessionoptionalboolProtectNewGameSessionoptional*bool #Default: true - Game sessions in ACTIVE status cannot be terminated during a scale-down event.
By default, new game sessions are protected and cannot be terminated during a scale-down event.
resourceCreationLimitPolicyoptionalResourceCreationLimitPolicyresource_creation_limit_policyoptionalResourceCreationLimitPolicyresourceCreationLimitPolicyoptionalResourceCreationLimitPolicyResourceCreationLimitPolicyoptionalResourceCreationLimitPolicyResourceCreationLimitPolicyoptionalResourceCreationLimitPolicy #Default: No resource creation limit policy
Default: a role will be created with default trust to Gamelift service principal.
notes
With a role set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes). If providing a custom role, it needs to trust the GameLift service principal (gamelift.amazonaws.com). No permission is required by default.
This property cannot be changed after the fleet is created.
runtimeConfigurationRuntimeConfigurationruntime_configurationRuntimeConfigurationruntimeConfigurationRuntimeConfigurationRuntimeConfigurationRuntimeConfigurationRuntimeConfigurationRuntimeConfiguration required #notes
Server processes run either an executable in a custom game build or a Realtime Servers script. GameLift launches the configured processes, manages their life cycle, and replaces them as needed. Each instance checks regularly for an updated runtime configuration.
A GameLift instance is limited to 50 processes running concurrently. To calculate the total number of processes in a runtime configuration, add the values of the ConcurrentExecutions parameter for each ServerProcess.
useCertificateoptionalbooleanuse_certificateoptionalbooluseCertificateoptionalBooleanUseCertificateoptionalboolUseCertificateoptional*bool #Default: TLS/SSL certificate are generated for the fleet
notes
GameLift uses the certificates to encrypt traffic between game clients and the game servers running on GameLift.
You can't change this property after you create the fleet.
Additionnal info: AWS Certificate Manager (ACM) certificates expire after 13 months. Certificate expiration can cause fleets to fail, preventing players from connecting to instances in the fleet. We recommend you replace fleets before 13 months, consider using fleet aliases for a smooth transition.
useSpotoptionalbooleanuse_spotoptionalbooluseSpotoptionalBooleanUseSpotoptionalboolUseSpotoptional*bool #Default: Gamelift fleet use on demand capacity
This property cannot be changed after the fleet is created.