Location
The Location resource allows you to manage AWS GameLift Locations for deploying game servers across various geographic regions to optimize performance and latency.
Minimal Example
Section titled “Minimal Example”Create a basic GameLift location with required properties.
import AWS from "alchemy/aws/control";
const gameLiftLocation = await AWS.GameLift.Location("myGameLiftLocation", { LocationName: "us-west-2", Tags: [ { Key: "Environment", Value: "Production" }, { Key: "Project", Value: "GameServerDeployment" } ]});
Advanced Configuration
Section titled “Advanced Configuration”Configure a GameLift location with the adoption option enabled, allowing you to adopt an existing resource if it already exists.
const adoptedLocation = await AWS.GameLift.Location("adoptedGameLiftLocation", { LocationName: "eu-central-1", adopt: true, Tags: [ { Key: "Environment", Value: "Staging" }, { Key: "Project", Value: "Testing" } ]});
Resource Metadata
Section titled “Resource Metadata”Access the metadata of a GameLift location, including its ARN, creation time, and last update time.
const locationMetadata = await AWS.GameLift.Location("locationMetadata", { LocationName: "ap-south-1"});
// Log the metadata detailsconsole.log(`ARN: ${locationMetadata.Arn}`);console.log(`Created At: ${locationMetadata.CreationTime}`);console.log(`Last Updated At: ${locationMetadata.LastUpdateTime}`);
Tagging for Resource Management
Section titled “Tagging for Resource Management”Create a location with meaningful tags for better resource management and organization.
const taggedLocation = await AWS.GameLift.Location("taggedLocation", { LocationName: "us-east-1", Tags: [ { Key: "Owner", Value: "GameDevTeam" }, { Key: "Version", Value: "1.0" } ]});