class FleetBase
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.GameLift.Alpha.FleetBase |
Go | github.com/aws/aws-cdk-go/awscdkgameliftalpha/v2#FleetBase |
Java | software.amazon.awscdk.services.gamelift.alpha.FleetBase |
Python | aws_cdk.aws_gamelift_alpha.FleetBase |
TypeScript (source) | @aws-cdk/aws-gamelift-alpha ยป FleetBase |
Implements
IConstruct
, IDependable
, IResource
, IFleet
, IGrantable
, IGame
Extends
Resource
Implemented by
Build
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
Resource
Props
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
fleet | string | The ARN of the fleet. |
fleet | string | The Identifier of the fleet. |
grant | IPrincipal | The principal this GameLift fleet is using. |
node | Node | The tree node. |
resource | string | The ARN to put into the destination field of a game session queue. |
stack | Stack | The stack in which this resource is defined. |
env
Type:
Resource
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
Name | Description |
---|---|
add | Defines an alias for this fleet. |
add | Adds a remote locations to deploy additional instances to and manage as part of the fleet. |
add | Adds a remote locations to deploy additional instances to and manage as part of the fleet. |
apply | 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. |
metric | Instances with ACTIVE status, which means they are running active server processes. |
metric | Target number of active instances that GameLift is working to maintain in the fleet. |
metric | Active instances that are currently hosting zero (0) game sessions. |
metric | Number of spot instances that have been interrupted. |
metric | Maximum number of instances that are allowed for the fleet. |
metric | Minimum number of instances allowed for the fleet. |
metric | Percentage of all active instances that are idle (calculated as IdleInstances / ActiveInstances). |
to | Returns a string representation of this construct. |
protected parse | |
protected parse | |
protected parse | |
protected parse | |
protected warn | |
static from | Import an existing fleet from its attributes. |
Alias(aliasName, options?)
addpublic addAlias(aliasName: string, options?: AliasOptions): Alias
Parameters
- aliasName
string
โ The name of the alias. - options
Alias
โ Alias options.Options
Returns
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,
});
InternalLocation(location)
addpublic 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.
Location(region, desiredCapacity?, minSize?, maxSize?)
addpublic 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.
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
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 the grantee
identity permissions to perform actions
.
metric(metricName, props?)
public metric(metricName: string, props?: MetricOptions): Metric
Parameters
- metricName
string
- props
Metric
Options
Returns
Return the given named metric for this fleet.
ActiveInstances(props?)
metricpublic metricActiveInstances(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
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.
DesiredInstances(props?)
metricpublic metricDesiredInstances(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
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.
IdleInstances(props?)
metricpublic metricIdleInstances(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
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.
InstanceInterruptions(props?)
metricpublic metricInstanceInterruptions(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Number of spot instances that have been interrupted.
MaxInstances(props?)
metricpublic metricMaxInstances(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
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.
MinInstances(props?)
metricpublic metricMinInstances(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
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.
PercentIdleInstances(props?)
metricpublic metricPercentIdleInstances(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Percentage of all active instances that are idle (calculated as IdleInstances / ActiveInstances).
This metric can be used for automatic scaling.
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
LocationCapacity(capacity?)
protected parseprotected parseLocationCapacity(capacity?: LocationCapacity): LocationCapacityProperty
Parameters
- capacity
Location
Capacity
Returns
Locations()
protected parseprotected parseLocations(): LocationConfigurationProperty[]
Returns
ResourceCreationLimitPolicy(props)
protected parseprotected parseResourceCreationLimitPolicy(props: FleetProps): ResourceCreationLimitPolicyProperty
Parameters
- props
Fleet
Props
Returns
RuntimeConfiguration(props)
protected parseprotected parseRuntimeConfiguration(props: FleetProps): RuntimeConfigurationProperty
Parameters
- props
Fleet
Props
Returns
VpcPeeringAuthorizations(scope)
protected warnprotected warnVpcPeeringAuthorizations(scope: Construct): void
Parameters
- scope
Construct
FleetAttributes(scope, id, attrs)
static frompublic static fromFleetAttributes(scope: Construct, id: string, attrs: FleetAttributes): IFleet
Parameters
- scope
Construct
- id
string
- attrs
Fleet
Attributes
Returns
Import an existing fleet from its attributes.