Class Alias
- All Implemented Interfaces:
IResource
,IAlias
,IGameSessionQueueDestination
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
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.
Example:
BuildFleet fleet; // Add an alias to an existing fleet using a dedicated fleet method Alias liveAlias = fleet.addAlias("live"); // You can also create a standalone alias // You can also create a standalone alias Alias.Builder.create(this, "TerminalAlias") .aliasName("terminal-alias") .terminalMessage("A terminal message") .build();
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.gamelift.alpha.IAlias
IAlias.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Alias
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
Alias
(software.amazon.jsii.JsiiObjectRef objRef) Alias
(software.constructs.Construct scope, String id, AliasProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IAlias
fromAliasArn
(software.constructs.Construct scope, String id, String aliasArn) (experimental) Import an existing alias from its ARN.static IAlias
fromAliasAttributes
(software.constructs.Construct scope, String id, AliasAttributes attrs) (experimental) Import an existing alias from its attributes.static IAlias
fromAliasId
(software.constructs.Construct scope, String id, String aliasId) (experimental) Import an existing alias from its identifier.(experimental) The ARN of the alias.(experimental) The Identifier of the alias.getFleet()
(experimental) A fleet that the alias points to.Methods inherited from class software.amazon.awscdk.services.gamelift.alpha.AliasBase
getResourceArnForDestination
Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Alias
protected Alias(software.amazon.jsii.JsiiObjectRef objRef) -
Alias
protected Alias(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Alias
@Stability(Experimental) public Alias(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull AliasProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
fromAliasArn
@Stability(Experimental) @NotNull public static IAlias fromAliasArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String aliasArn) (experimental) Import an existing alias from its ARN.- Parameters:
scope
- This parameter is required.id
- This parameter is required.aliasArn
- This parameter is required.
-
fromAliasAttributes
@Stability(Experimental) @NotNull public static IAlias fromAliasAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull AliasAttributes attrs) (experimental) Import an existing alias from its attributes.- Parameters:
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.
-
fromAliasId
@Stability(Experimental) @NotNull public static IAlias fromAliasId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String aliasId) (experimental) Import an existing alias from its identifier.- Parameters:
scope
- This parameter is required.id
- This parameter is required.aliasId
- This parameter is required.
-
getAliasArn
(experimental) The ARN of the alias.- Specified by:
getAliasArn
in interfaceIAlias
- Specified by:
getAliasArn
in classAliasBase
-
getAliasId
(experimental) The Identifier of the alias.- Specified by:
getAliasId
in interfaceIAlias
- Specified by:
getAliasId
in classAliasBase
-
getFleet
(experimental) A fleet that the alias points to.
-