Skip to content
GitHubXDiscord

Alias

The Alias resource lets you manage AWS GameLift Aliases to route player traffic to game server fleets.

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"
}
});

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" }
]
});

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."
}
});

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
});