@aws-cdk_aws-gamelift-alpha.Alias

class Alias (construct) ๐Ÿ”น

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

Implements IConstruct, IDependable, IResource, IAlias, IGameSessionQueueDestination

A Amazon GameLift alias is used to abstract a fleet designation.

Fleet designations tell GameLift where to search for available resources when creating new game sessions for players. Use aliases instead of specific fleet IDs to seamlessly switch player traffic from one fleet to another by changing the alias's target location.

Aliases are useful in games that don't use queues. Switching fleets in a queue is a simple matter of creating a new fleet, adding it to the queue, and removing the old fleet, none of which is visible to players. In contrast, game clients that don't use queues must specify which fleet to use when communicating with the GameLift service. Without aliases, a fleet switch requires updates to your game code and possibly distribution of an updated game clients to players.

When updating the fleet-id an alias points to, there is a transition period of up to 2 minutes where game sessions on the alias may end up on the old fleet.

See also: https://docs.aws.amazon.com/gamelift/latest/developerguide/aliases-creating.html

Example

declare const fleet: gamelift.BuildFleet;

// Add an alias to an existing fleet using a dedicated fleet method
const liveAlias = fleet.addAlias('live');

// You can also create a standalone alias
new gamelift.Alias(this, 'TerminalAlias', {
  aliasName: 'terminal-alias',
  terminalMessage: 'A terminal message',
});

Initializer

new Alias(scope: Construct, id: string, props: AliasProps)

Parameters

  • scope Construct
  • id string
  • props AliasProps

Construct Props

NameTypeDescription
aliasName๐Ÿ”นstringName of this alias.
description?๐Ÿ”นstringA human-readable description of the alias.
fleet?๐Ÿ”นIFleetA fleet that the alias points to. If specified, the alias resolves to one specific fleet.
terminalMessage?๐Ÿ”นstringThe message text to be used with a terminal routing strategy.

aliasName๐Ÿ”น

Type: string

Name of this alias.


description?๐Ÿ”น

Type: string (optional, default: no description)

A human-readable description of the alias.


fleet?๐Ÿ”น

Type: IFleet (optional, default: no fleet that the alias points to.)

A fleet that the alias points to. If specified, the alias resolves to one specific fleet.

At least one of fleet and terminalMessage must be provided.


terminalMessage?๐Ÿ”น

Type: string (optional, default: no terminal message)

The message text to be used with a terminal routing strategy.

At least one of fleet and terminalMessage must be provided.

Properties

NameTypeDescription
aliasArn๐Ÿ”นstringThe ARN of the alias.
aliasId๐Ÿ”นstringThe Identifier of the alias.
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
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.
fleet?๐Ÿ”นIFleetA fleet that the alias points to.

aliasArn๐Ÿ”น

Type: string

The ARN of the alias.


aliasId๐Ÿ”น

Type: string

The Identifier of the alias.


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.


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.


fleet?๐Ÿ”น

Type: IFleet (optional)

A fleet that the alias points to.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
toString()๐Ÿ”นReturns a string representation of this construct.
static fromAliasArn(scope, id, aliasArn)๐Ÿ”นImport an existing alias from its ARN.
static fromAliasAttributes(scope, id, attrs)๐Ÿ”นImport an existing alias from its attributes.
static fromAliasId(scope, id, aliasId)๐Ÿ”นImport an existing alias from its identifier.

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).


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromAliasArn(scope, id, aliasArn)๐Ÿ”น

public static fromAliasArn(scope: Construct, id: string, aliasArn: string): IAlias

Parameters

  • scope Construct
  • id string
  • aliasArn string

Returns

  • IAlias

Import an existing alias from its ARN.


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

public static fromAliasAttributes(scope: Construct, id: string, attrs: AliasAttributes): IAlias

Parameters

  • scope Construct
  • id string
  • attrs AliasAttributes

Returns

  • IAlias

Import an existing alias from its attributes.


static fromAliasId(scope, id, aliasId)๐Ÿ”น

public static fromAliasId(scope: Construct, id: string, aliasId: string): IAlias

Parameters

  • scope Construct
  • id string
  • aliasId string

Returns

  • IAlias

Import an existing alias from its identifier.