Skip to content
v2.277.0

Experimental

@aws-cdk/aws-gamelift-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

FleetProps Struct ​

Properties for a new Gamelift fleet.

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 * as cdk from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';

declare const instanceType: ec2.InstanceType;
declare const role: iam.Role;
declare const vpc: ec2.Vpc;
const fleetProps: gamelift_alpha.FleetProps = {
  fleetName: 'fleetName',
  instanceType: instanceType,
  runtimeConfiguration: {
    serverProcesses: [{
      launchPath: 'launchPath',

      // the properties below are optional
      concurrentExecutions: 123,
      parameters: 'parameters',
    }],

    // the properties below are optional
    gameSessionActivationTimeout: cdk.Duration.minutes(30),
    maxConcurrentGameSessionActivations: 123,
  },

  // the properties below are optional
  description: 'description',
  desiredCapacity: 123,
  locations: [{
    region: 'region',

    // the properties below are optional
    capacity: {
      desiredCapacity: 123,
      maxSize: 123,
      minSize: 123,
    },
  }],
  maxSize: 123,
  metricGroup: 'metricGroup',
  minSize: 123,
  peerVpc: vpc,
  protectNewGameSession: false,
  resourceCreationLimitPolicy: {
    newGameSessionsPerCreator: 123,
    policyPeriod: cdk.Duration.minutes(30),
  },
  role: role,
  useCertificate: false,
  useSpot: false,
};
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
import aws_cdk as cdk
from aws_cdk import aws_ec2 as ec2
from aws_cdk import aws_iam as iam

# instance_type: ec2.InstanceType
# role: iam.Role
# vpc: ec2.Vpc

fleet_props = gamelift_alpha.FleetProps(
    fleet_name="fleetName",
    instance_type=instance_type,
    runtime_configuration=gamelift_alpha.RuntimeConfiguration(
        server_processes=[gamelift_alpha.ServerProcess(
            launch_path="launchPath",

            # the properties below are optional
            concurrent_executions=123,
            parameters="parameters"
        )],

        # the properties below are optional
        game_session_activation_timeout=cdk.Duration.minutes(30),
        max_concurrent_game_session_activations=123
    ),

    # the properties below are optional
    description="description",
    desired_capacity=123,
    locations=[gamelift_alpha.Location(
        region="region",

        # the properties below are optional
        capacity=gamelift_alpha.LocationCapacity(
            desired_capacity=123,
            max_size=123,
            min_size=123
        )
    )],
    max_size=123,
    metric_group="metricGroup",
    min_size=123,
    peer_vpc=vpc,
    protect_new_game_session=False,
    resource_creation_limit_policy=gamelift_alpha.ResourceCreationLimitPolicy(
        new_game_sessions_per_creator=123,
        policy_period=cdk.Duration.minutes(30)
    ),
    role=role,
    use_certificate=False,
    use_spot=False
)
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.*;
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.iam.*;

InstanceType instanceType;
Role role;
Vpc vpc;

FleetProps fleetProps = FleetProps.builder()
        .fleetName("fleetName")
        .instanceType(instanceType)
        .runtimeConfiguration(RuntimeConfiguration.builder()
                .serverProcesses(List.of(ServerProcess.builder()
                        .launchPath("launchPath")

                        // the properties below are optional
                        .concurrentExecutions(123)
                        .parameters("parameters")
                        .build()))

                // the properties below are optional
                .gameSessionActivationTimeout(Duration.minutes(30))
                .maxConcurrentGameSessionActivations(123)
                .build())

        // the properties below are optional
        .description("description")
        .desiredCapacity(123)
        .locations(List.of(Location.builder()
                .region("region")

                // the properties below are optional
                .capacity(LocationCapacity.builder()
                        .desiredCapacity(123)
                        .maxSize(123)
                        .minSize(123)
                        .build())
                .build()))
        .maxSize(123)
        .metricGroup("metricGroup")
        .minSize(123)
        .peerVpc(vpc)
        .protectNewGameSession(false)
        .resourceCreationLimitPolicy(ResourceCreationLimitPolicy.builder()
                .newGameSessionsPerCreator(123)
                .policyPeriod(Duration.minutes(30))
                .build())
        .role(role)
        .useCertificate(false)
        .useSpot(false)
        .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;
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.IAM;

InstanceType instanceType;
Role role;
Vpc vpc;

var fleetProps = new FleetProps {
    FleetName = "fleetName",
    InstanceType = instanceType,
    RuntimeConfiguration = new RuntimeConfiguration {
        ServerProcesses = new [] { new ServerProcess {
            LaunchPath = "launchPath",

            // the properties below are optional
            ConcurrentExecutions = 123,
            Parameters = "parameters"
        } },

        // the properties below are optional
        GameSessionActivationTimeout = Duration.Minutes(30),
        MaxConcurrentGameSessionActivations = 123
    },

    // the properties below are optional
    Description = "description",
    DesiredCapacity = 123,
    Locations = new [] { new Location {
        Region = "region",

        // the properties below are optional
        Capacity = new LocationCapacity {
            DesiredCapacity = 123,
            MaxSize = 123,
            MinSize = 123
        }
    } },
    MaxSize = 123,
    MetricGroup = "metricGroup",
    MinSize = 123,
    PeerVpc = vpc,
    ProtectNewGameSession = false,
    ResourceCreationLimitPolicy = new ResourceCreationLimitPolicy {
        NewGameSessionsPerCreator = 123,
        PolicyPeriod = Duration.Minutes(30)
    },
    Role = role,
    UseCertificate = false,
    UseSpot = false
};
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"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var instanceType InstanceType
var role Role
var vpc Vpc

fleetProps := &FleetProps{
	FleetName: jsii.String("fleetName"),
	InstanceType: instanceType,
	RuntimeConfiguration: &RuntimeConfiguration{
		ServerProcesses: []ServerProcess{
			&ServerProcess{
				LaunchPath: jsii.String("launchPath"),

				// the properties below are optional
				ConcurrentExecutions: jsii.Number(123),
				Parameters: jsii.String("parameters"),
			},
		},

		// the properties below are optional
		GameSessionActivationTimeout: cdk.Duration_Minutes(jsii.Number(30)),
		MaxConcurrentGameSessionActivations: jsii.Number(123),
	},

	// the properties below are optional
	Description: jsii.String("description"),
	DesiredCapacity: jsii.Number(123),
	Locations: []Location{
		&Location{
			Region: jsii.String("region"),

			// the properties below are optional
			Capacity: &LocationCapacity{
				DesiredCapacity: jsii.Number(123),
				MaxSize: jsii.Number(123),
				MinSize: jsii.Number(123),
			},
		},
	},
	MaxSize: jsii.Number(123),
	MetricGroup: jsii.String("metricGroup"),
	MinSize: jsii.Number(123),
	PeerVpc: vpc,
	ProtectNewGameSession: jsii.Boolean(false),
	ResourceCreationLimitPolicy: &ResourceCreationLimitPolicy{
		NewGameSessionsPerCreator: jsii.Number(123),
		PolicyPeriod: cdk.Duration_*Minutes(jsii.Number(30)),
	},
	Role: role,
	UseCertificate: jsii.Boolean(false),
	UseSpot: jsii.Boolean(false),
}

Properties ​

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
A human-readable description of the fleet.

Default: no description is provided

desiredCapacityoptionalnumberdesired_capacityoptionalint | floatdesiredCapacityoptionalNumberDesiredCapacityoptionaldoubleDesiredCapacityoptional*float64#
The number of EC2 instances that you want this fleet to host.

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.

fleetNamestringfleet_namestrfleetNameStringFleetNamestringFleetName*stringrequired#
A descriptive label that is associated with a fleet.

Fleet names do not need to be unique.

instanceTypeInstanceTypeinstance_typeInstanceTypeinstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceTyperequired#
The GameLift-supported Amazon EC2 instance type to use for all fleet instances.

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#
A set of remote locations to deploy additional instances to and manage as part of the fleet.

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#
The maximum number of instances that are allowed in the specified fleet location.
metricGroupoptionalstringmetric_groupoptionalstrmetricGroupoptionalStringMetricGroupoptionalstringMetricGroupoptional*string#
The name of an AWS CloudWatch metric group to add this fleet to.

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#
The minimum number of instances that are allowed in the specified fleet location.
peerVpcoptionalIVpcpeer_vpcoptionalIVpcpeerVpcoptionalIVpcPeerVpcoptionalIVpcPeerVpcoptionalIVpc#
A VPC peering connection between your GameLift-hosted game servers and your other non-GameLift resources.

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#
The status of termination protection for active game sessions on the fleet.

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#
A policy that limits the number of game sessions that an individual player can create on instances in this fleet within a specified span of time.

Default: No resource creation limit policy

roleoptionalIRoleroleoptionalIRoleroleoptionalIRoleRoleoptionalIRoleRoleoptionalIRole#
The IAM role assumed by GameLift fleet instances to access AWS ressources.

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_configurationRuntimeConfigurationruntimeConfigurationRuntimeConfigurationRuntimeConfigurationRuntimeConfigurationRuntimeConfigurationRuntimeConfigurationrequired#
A collection of server process configurations that describe the set of processes to run on each instance in a fleet.
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#
Prompts GameLift to generate a TLS/SSL certificate for the fleet.

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#
Indicates whether to use On-Demand or Spot instances for this fleet. By default, fleet use on demand capacity.

Default: Gamelift fleet use on demand capacity

This property cannot be changed after the fleet is created.