Alias
The Alias resource lets you manage AWS GameLift Aliases to route player traffic to game server fleets.
Minimal Example
Section titled “Minimal Example”Create a basic GameLift alias with a routing strategy.
import AWS from "alchemy/aws/control";
const gameLiftAlias = await AWS.GameLift.Alias("basicAlias", { Name: "BasicGameAlias", RoutingStrategy: { Type: "SIMPLE", FleetId: "fleet-12345678" }});
Enhanced Description and Tags
Section titled “Enhanced Description and Tags”Configure an alias with a description and tags for better management.
const taggedAlias = await AWS.GameLift.Alias("taggedAlias", { Name: "TaggedGameAlias", Description: "This alias routes traffic to the main game server fleet.", RoutingStrategy: { Type: "SIMPLE", FleetId: "fleet-87654321" }, Tags: [ { Key: "Environment", Value: "Production" }, { Key: "Game", Value: "MyAwesomeGame" } ]});
Advanced Routing Strategy
Section titled “Advanced Routing Strategy”Create an alias with a complex routing strategy that includes multiple fleet options.
const advancedAlias = await AWS.GameLift.Alias("advancedAlias", { Name: "AdvancedGameAlias", Description: "Routes players based on player count.", RoutingStrategy: { Type: "TARGET_BASED", FleetId: "fleet-11223344", Message: "Directing traffic to the best available server based on load." }});
Adoption of Existing Resources
Section titled “Adoption of Existing Resources”Create an alias while adopting an existing resource if it already exists.
const existingAlias = await AWS.GameLift.Alias("existingAlias", { Name: "ExistingGameAlias", RoutingStrategy: { Type: "SIMPLE", FleetId: "fleet-55667788" }, adopt: true});