@aws-cdk_aws-gamelift-alpha.FleetBase

class FleetBase ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.GameLift.Alpha.FleetBase
Gogithub.com/aws/aws-cdk-go/awscdkgameliftalpha/v2#FleetBase
Javasoftware.amazon.awscdk.services.gamelift.alpha.FleetBase
Pythonaws_cdk.aws_gamelift_alpha.FleetBase
TypeScript (source)@aws-cdk/aws-gamelift-alpha ยป FleetBase

Implements IConstruct, IDependable, IResource, IFleet, IGrantable, IGameSessionQueueDestination

Extends Resource

Implemented by BuildFleet

Base class for new and imported GameLift fleet.

Example

// 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_iam as iam } from 'aws-cdk-lib';

declare const role: iam.Role;
const fleetBase = gamelift_alpha.FleetBase.fromFleetAttributes(this, 'MyFleetBase', {
  fleetArn: 'fleetArn',
  fleetId: 'fleetId',
  role: role,
});

Initializer

new FleetBase(scope: Construct, id: string, props?: ResourceProps)

Parameters

  • scope Construct
  • id string
  • props ResourceProps

Properties

NameTypeDescription
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
fleetArn๐Ÿ”นstringThe ARN of the fleet.
fleetId๐Ÿ”นstringThe Identifier of the fleet.
grantPrincipal๐Ÿ”นIPrincipalThe principal this GameLift fleet is using.
node๐Ÿ”นNodeThe tree node.
resourceArnForDestination๐Ÿ”นstringThe ARN to put into the destination field of a game session queue.
stack๐Ÿ”นStackThe stack in which this resource is defined.

env๐Ÿ”น

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


fleetArn๐Ÿ”น

Type: string

The ARN of the fleet.


fleetId๐Ÿ”น

Type: string

The Identifier of the fleet.


grantPrincipal๐Ÿ”น

Type: IPrincipal

The principal this GameLift fleet is using.


node๐Ÿ”น

Type: Node

The tree node.


resourceArnForDestination๐Ÿ”น

Type: string

The ARN to put into the destination field of a game session queue.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
addAlias(aliasName, options?)๐Ÿ”นDefines an alias for this fleet.
addInternalLocation(location)๐Ÿ”นAdds a remote locations to deploy additional instances to and manage as part of the fleet.
addLocation(region, desiredCapacity?, minSize?, maxSize?)๐Ÿ”นAdds a remote locations to deploy additional instances to and manage as part of the fleet.
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
grant(grantee, ...actions)๐Ÿ”นGrant the grantee identity permissions to perform actions.
metric(metricName, props?)๐Ÿ”นReturn the given named metric for this fleet.
metricActiveInstances(props?)๐Ÿ”นInstances with ACTIVE status, which means they are running active server processes.
metricDesiredInstances(props?)๐Ÿ”นTarget number of active instances that GameLift is working to maintain in the fleet.
metricIdleInstances(props?)๐Ÿ”นActive instances that are currently hosting zero (0) game sessions.
metricInstanceInterruptions(props?)๐Ÿ”นNumber of spot instances that have been interrupted.
metricMaxInstances(props?)๐Ÿ”นMaximum number of instances that are allowed for the fleet.
metricMinInstances(props?)๐Ÿ”นMinimum number of instances allowed for the fleet.
metricPercentIdleInstances(props?)๐Ÿ”นPercentage of all active instances that are idle (calculated as IdleInstances / ActiveInstances).
toString()๐Ÿ”นReturns a string representation of this construct.
protected parseLocationCapacity(capacity?)๐Ÿ”น
protected parseLocations()๐Ÿ”น
protected parseResourceCreationLimitPolicy(props)๐Ÿ”น
protected parseRuntimeConfiguration(props)๐Ÿ”น
protected warnVpcPeeringAuthorizations(scope)๐Ÿ”น
static fromFleetAttributes(scope, id, attrs)๐Ÿ”นImport an existing fleet from its attributes.

addAlias(aliasName, options?)๐Ÿ”น

public addAlias(aliasName: string, options?: AliasOptions): Alias

Parameters

  • aliasName string โ€” The name of the alias.
  • options AliasOptions โ€” Alias options.

Returns

  • Alias

Defines an alias for this fleet.

declare const fleet: gamelift.FleetBase;

fleet.addAlias('Live');

// Is equivalent to

new gamelift.Alias(this, 'AliasLive', {
  aliasName: 'Live',
  fleet: fleet,
});

addInternalLocation(location)๐Ÿ”น

public addInternalLocation(location: Location): void

Parameters

  • location Location โ€” The location to add.

Adds a remote locations to deploy additional instances to and manage as part of the fleet.


addLocation(region, desiredCapacity?, minSize?, maxSize?)๐Ÿ”น

public addLocation(region: string, desiredCapacity?: number, minSize?: number, maxSize?: number): void

Parameters

  • region string โ€” The AWS region to add.
  • desiredCapacity number
  • minSize number
  • maxSize number

Adds a remote locations to deploy additional instances to and manage as part of the fleet.


applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


grant(grantee, ...actions)๐Ÿ”น

public grant(grantee: IGrantable, ...actions: string[]): Grant

Parameters

  • grantee IGrantable
  • actions string

Returns

  • Grant

Grant the grantee identity permissions to perform actions.


metric(metricName, props?)๐Ÿ”น

public metric(metricName: string, props?: MetricOptions): Metric

Parameters

  • metricName string
  • props MetricOptions

Returns

  • Metric

Return the given named metric for this fleet.


metricActiveInstances(props?)๐Ÿ”น

public metricActiveInstances(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

Instances with ACTIVE status, which means they are running active server processes.

The count includes idle instances and those that are hosting one or more game sessions. This metric measures current total instance capacity.

This metric can be used with automatic scaling.


metricDesiredInstances(props?)๐Ÿ”น

public metricDesiredInstances(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

Target number of active instances that GameLift is working to maintain in the fleet.

With automatic scaling, this value is determined based on the scaling policies currently in force. Without automatic scaling, this value is set manually. This metric is not available when viewing data for fleet metric groups.


metricIdleInstances(props?)๐Ÿ”น

public metricIdleInstances(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

Active instances that are currently hosting zero (0) game sessions.

This metric measures capacity that is available but unused. This metric can be used with automatic scaling.


metricInstanceInterruptions(props?)๐Ÿ”น

public metricInstanceInterruptions(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

Number of spot instances that have been interrupted.


metricMaxInstances(props?)๐Ÿ”น

public metricMaxInstances(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

Maximum number of instances that are allowed for the fleet.

A fleet's instance maximum determines the capacity ceiling during manual or automatic scaling up. This metric is not available when viewing data for fleet metric groups.


metricMinInstances(props?)๐Ÿ”น

public metricMinInstances(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

Minimum number of instances allowed for the fleet.

A fleet's instance minimum determines the capacity floor during manual or automatic scaling down. This metric is not available when viewing data for fleet metric groups.


metricPercentIdleInstances(props?)๐Ÿ”น

public metricPercentIdleInstances(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

Percentage of all active instances that are idle (calculated as IdleInstances / ActiveInstances).

This metric can be used for automatic scaling.


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.


protected parseLocationCapacity(capacity?)๐Ÿ”น

protected parseLocationCapacity(capacity?: LocationCapacity): LocationCapacityProperty

Parameters

  • capacity LocationCapacity

Returns

  • LocationCapacityProperty

protected parseLocations()๐Ÿ”น

protected parseLocations(): LocationConfigurationProperty[]

Returns

  • LocationConfigurationProperty[]

protected parseResourceCreationLimitPolicy(props)๐Ÿ”น

protected parseResourceCreationLimitPolicy(props: FleetProps): ResourceCreationLimitPolicyProperty

Parameters

  • props FleetProps

Returns

  • ResourceCreationLimitPolicyProperty

protected parseRuntimeConfiguration(props)๐Ÿ”น

protected parseRuntimeConfiguration(props: FleetProps): RuntimeConfigurationProperty

Parameters

  • props FleetProps

Returns

  • RuntimeConfigurationProperty

protected warnVpcPeeringAuthorizations(scope)๐Ÿ”น

protected warnVpcPeeringAuthorizations(scope: Construct): void

Parameters

  • scope Construct

static fromFleetAttributes(scope, id, attrs)๐Ÿ”น

public static fromFleetAttributes(scope: Construct, id: string, attrs: FleetAttributes): IFleet

Parameters

  • scope Construct
  • id string
  • attrs FleetAttributes

Returns

  • IFleet

Import an existing fleet from its attributes.