CreateLocationCommand

Creates a custom location for use in an Anywhere fleet.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { GameLiftClient, CreateLocationCommand } from "@aws-sdk/client-gamelift"; // ES Modules import
// const { GameLiftClient, CreateLocationCommand } = require("@aws-sdk/client-gamelift"); // CommonJS import
const client = new GameLiftClient(config);
const input = { // CreateLocationInput
  LocationName: "STRING_VALUE", // required
  Tags: [ // TagList
    { // Tag
      Key: "STRING_VALUE", // required
      Value: "STRING_VALUE", // required
    },
  ],
};
const command = new CreateLocationCommand(input);
const response = await client.send(command);
// { // CreateLocationOutput
//   Location: { // LocationModel
//     LocationName: "STRING_VALUE",
//     LocationArn: "STRING_VALUE",
//   },
// };

CreateLocationCommand Input

See CreateLocationCommandInput for more details

Parameter
Type
Description
LocationName
Required
string | undefined

A descriptive name for the custom location.

Tags
Tag[] | undefined

A list of labels to assign to the new resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management, and cost allocation. For more information, see Tagging Amazon Web Services Resources  in the Amazon Web Services General Rareference.

CreateLocationCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Location
LocationModel | undefined

The details of the custom location you created.

Throws

Name
Fault
Details
ConflictException
client

The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.

InternalServiceException
server

The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.

InvalidRequestException
client

One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.

LimitExceededException
client

The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying.

TaggingFailedException
client

The requested tagging operation did not succeed. This may be due to invalid tag format or the maximum tag limit may have been exceeded. Resolve the issue before retrying.

UnauthorizedException
client

The client failed authentication. Clients should not retry such requests.

GameLiftServiceException
Base exception class for all service exceptions from GameLift service.