CreateFleetLocations - Amazon GameLift

CreateFleetLocations

Adds remote locations to a fleet and begins populating the new locations with EC2 instances. The new instances conform to the fleet's instance type, auto-scaling, and other configuration settings.

Note

This operation cannot be used with fleets that don't support remote locations. Fleets can have multiple locations only if they reside in AWS Regions that support this feature and were created after the feature was released in March 2021.

To add fleet locations, specify the fleet to be updated and provide a list of one or more locations.

If successful, this operation returns the list of added locations with their status set to NEW. Amazon GameLift initiates the process of starting an instance in each added location. You can track the status of each new location by monitoring location creation events using DescribeFleetEvents.

Learn more

Setting up fleets

Multi-location fleets

Request Syntax

{ "FleetId": "string", "Locations": [ { "Location": "string" } ] }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Note

In the following list, the required parameters are described first.

FleetId

A unique identifier for the fleet to add locations to. You can use either the fleet ID or ARN value.

Type: String

Pattern: ^fleet-\S+|^arn:.*:fleet\/fleet-\S+

Required: Yes

Locations

A list of locations to deploy additional instances to and manage as part of the fleet. You can add any Amazon GameLift-supported AWS Region as a remote location, in the form of an AWS Region code such as us-west-2.

Type: Array of LocationConfiguration objects

Array Members: Minimum number of 1 item. Maximum number of 100 items.

Required: Yes

Response Syntax

{ "FleetArn": "string", "FleetId": "string", "LocationStates": [ { "Location": "string", "Status": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

FleetArn

The Amazon Resource Name (ARN) that is assigned to a Amazon GameLift fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is arn:aws:gamelift:<region>::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912.

Type: String

Pattern: ^arn:.*:fleet\/fleet-\S+

FleetId

A unique identifier for the fleet that was updated with new locations.

Type: String

Pattern: ^fleet-\S+|^arn:.*:fleet\/fleet-\S+

LocationStates

The remote locations that are being added to the fleet, and the life-cycle status of each location. For new locations, the status is set to NEW. During location creation, Amazon GameLift updates each location's status as instances are deployed there and prepared for game hosting. This list does not include the fleet home Region or any remote locations that were already added to the fleet.

Type: Array of LocationState objects

Errors

For information about the errors that are common to all actions, see Common Errors.

ConflictException

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.

HTTP Status Code: 400

InternalServiceException

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

HTTP Status Code: 500

InvalidFleetStatusException

The requested operation would cause a conflict with the current state of a resource associated with the request and/or the fleet. Resolve the conflict before retrying.

HTTP Status Code: 400

InvalidRequestException

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

HTTP Status Code: 400

LimitExceededException

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

HTTP Status Code: 400

NotFoundException

The requested resources was not found. The resource was either not created yet or deleted.

HTTP Status Code: 400

UnauthorizedException

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

HTTP Status Code: 400

UnsupportedRegionException

The requested operation is not supported in the Region specified.

HTTP Status Code: 400

Examples

Add remote locations to an existing fleet

This example adds three five remote locations to a fleet that resides in the AWS Region eu-central-1. As shown, the status of each new location is initially set to NEW.

Sample Request

{ "FleetId": "fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", "Locations": [ { "Location": "me-south-1"}, { "Location": "eu-west-2"}, { "Location": "eu-south-1"}, { "Location": "eu-west-3"}, { "Location": "eu-north-1"} ] }

Sample Response

{ "FleetArn": "arn:aws:gamelift:us-west-2::fleet/fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", "FleetId": "fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", "LocationStates": [ { "Location": "eu-north-1", "Status": "NEW" }, { "Location": "eu-west-3", "Status": "NEW" }, { "Location": "eu-south-1", "Status": "NEW" }, { "Location": "eu-west-2", "Status": "NEW" }, { "Location": "me-south-1", "Status": "NEW" } ] }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: