Skip to main content

fleets

Creates, updates, deletes, gets or lists a fleets resource.

Overview

Namefleets
TypeResource
Idaws.gamelift.fleets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
fleet_idstringA set of fleet IDs that match the list request.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_fleetsselectregionThis API works with the following fleet types: EC2, Anywhere, Container Retrieves a collection of fleet resources in an Amazon Web Services Region. You can filter the result set to find only those fleets that are deployed with a specific build or script. For fleets that have multiple locations, this operation retrieves fleets based on their home Region only. You can use operation in the following ways: To get a list of all fleets in a Region, don't provide a build or script identifier. To get a list of all fleets where a specific game build is deployed, provide the build ID. To get a list of all Amazon GameLift Servers Realtime fleets with a specific configuration script, provide the script ID. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, this operation returns a list of fleet IDs that match the request parameters. A NextToken value is also returned if there are more result pages to retrieve. Fleet IDs are returned in no particular order.
create_fleetinsertregion, NameThis API works with the following fleet types: EC2, Anywhere, Container Creates a fleet of compute resources to host your game servers. Use this operation to set up a fleet for the following compute types: Managed EC2 fleet An EC2 fleet is a set of Amazon Elastic Compute Cloud (Amazon EC2) instances. Your game server build is deployed to each fleet instance. Amazon GameLift Servers manages the fleet's instances and controls the lifecycle of game server processes, which host game sessions for players. EC2 fleets can have instances in multiple locations. Each instance in the fleet is designated a Compute. To create an EC2 fleet, provide these required parameters: Either BuildId or ScriptId ComputeType set to EC2 (the default value) EC2InboundPermissions EC2InstanceType FleetType Name RuntimeConfiguration with at least one ServerProcesses configuration If successful, this operation creates a new fleet resource and places it in NEW status while Amazon GameLift Servers initiates the fleet creation workflow. To debug your fleet, fetch logs, view performance metrics or other actions on the fleet, create a development fleet with port 22/3389 open. As a best practice, we recommend opening ports for remote access only when you need them and closing them when you're finished. When the fleet status is ACTIVE, you can adjust capacity settings and turn autoscaling on/off for each location. A managed fleet's runtime environment depends on the Amazon Machine Image (AMI) version it uses. When a new fleet is created, Amazon GameLift Servers assigns the latest available AMI version to the fleet, and all compute instances in that fleet are deployed with that version. To update the AMI version, you must create a new fleet. As a best practice, we recommend replacing your managed fleets every 30 days to maintain a secure and up-to-date runtime environment for your hosted game servers. For guidance, see Security best practices for Amazon GameLift Servers. Anywhere fleet An Anywhere fleet represents compute resources that are not owned or managed by Amazon GameLift Servers. You might create an Anywhere fleet with your local machine for testing, or use one to host game servers with on-premises hardware or other game hosting solutions. To create an Anywhere fleet, provide these required parameters: ComputeType set to ANYWHERE Locations specifying a custom location Name If successful, this operation creates a new fleet resource and places it in ACTIVE status. You can register computes with a fleet in ACTIVE status. Learn more Setting up fleets Debug fleet creation issues Multi-location fleets
delete_fleetdeleteregionThis API works with the following fleet types: EC2, Anywhere Deletes all resources and information related to a fleet and shuts down any currently running fleet instances, including those in remote locations. If the fleet being deleted has a VPC peering connection, you first need to get a valid authorization (good for 24 hours) by calling CreateVpcPeeringAuthorization. You don't need to explicitly delete the VPC peering connection. To delete a fleet, specify the fleet ID to be terminated. During the deletion process, the fleet status is changed to DELETING. When completed, the status switches to TERMINATED and the fleet event FLEET_DELETED is emitted. Learn more Setting up Amazon GameLift Servers Fleets
start_fleet_actionsexecregion, FleetId, ActionsThis API works with the following fleet types: EC2, Container Resumes certain types of activity on fleet instances that were suspended with StopFleetActions. For multi-location fleets, fleet actions are managed separately for each location. Currently, this operation is used to restart a fleet's auto-scaling activity. This operation can be used in the following ways: To restart actions on instances in the fleet's home Region, provide a fleet ID and the type of actions to resume. To restart actions on instances in one of the fleet's remote locations, provide a fleet ID, a location name, and the type of actions to resume. If successful, Amazon GameLift Servers once again initiates scaling events as triggered by the fleet's scaling policies. If actions on the fleet location were never stopped, this operation will have no effect. Learn more Setting up Amazon GameLift Servers fleets
stop_fleet_actionsexecregion, FleetId, ActionsThis API works with the following fleet types: EC2, Container Suspends certain types of activity in a fleet location. Currently, this operation is used to stop auto-scaling activity. For multi-location fleets, fleet actions are managed separately for each location. Stopping fleet actions has several potential purposes. It allows you to temporarily stop auto-scaling activity but retain your scaling policies for use in the future. For multi-location fleets, you can set up fleet-wide auto-scaling, and then opt out of it for certain locations. This operation can be used in the following ways: To stop actions on instances in the fleet's home Region, provide a fleet ID and the type of actions to suspend. To stop actions on instances in one of the fleet's remote locations, provide a fleet ID, a location name, and the type of actions to suspend. If successful, Amazon GameLift Servers no longer initiates scaling events except in response to manual changes using UpdateFleetCapacity. To restart fleet actions again, call StartFleetActions. Learn more Setting up Amazon GameLift Servers Fleets

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

This API works with the following fleet types: EC2, Anywhere, Container Retrieves a collection of fleet resources in an Amazon Web Services Region. You can filter the result set to find only those fleets that are deployed with a specific build or script. For fleets that have multiple locations, this operation retrieves fleets based on their home Region only. You can use operation in the following ways: To get a list of all fleets in a Region, don't provide a build or script identifier. To get a list of all fleets where a specific game build is deployed, provide the build ID. To get a list of all Amazon GameLift Servers Realtime fleets with a specific configuration script, provide the script ID. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, this operation returns a list of fleet IDs that match the request parameters. A NextToken value is also returned if there are more result pages to retrieve. Fleet IDs are returned in no particular order.

SELECT
fleet_id
FROM aws.gamelift.fleets
WHERE region = '{{ region }}' -- required
;

INSERT examples

This API works with the following fleet types: EC2, Anywhere, Container Creates a fleet of compute resources to host your game servers. Use this operation to set up a fleet for the following compute types: Managed EC2 fleet An EC2 fleet is a set of Amazon Elastic Compute Cloud (Amazon EC2) instances. Your game server build is deployed to each fleet instance. Amazon GameLift Servers manages the fleet's instances and controls the lifecycle of game server processes, which host game sessions for players. EC2 fleets can have instances in multiple locations. Each instance in the fleet is designated a Compute. To create an EC2 fleet, provide these required parameters: Either BuildId or ScriptId ComputeType set to EC2 (the default value) EC2InboundPermissions EC2InstanceType FleetType Name RuntimeConfiguration with at least one ServerProcesses configuration If successful, this operation creates a new fleet resource and places it in NEW status while Amazon GameLift Servers initiates the fleet creation workflow. To debug your fleet, fetch logs, view performance metrics or other actions on the fleet, create a development fleet with port 22/3389 open. As a best practice, we recommend opening ports for remote access only when you need them and closing them when you're finished. When the fleet status is ACTIVE, you can adjust capacity settings and turn autoscaling on/off for each location. A managed fleet's runtime environment depends on the Amazon Machine Image (AMI) version it uses. When a new fleet is created, Amazon GameLift Servers assigns the latest available AMI version to the fleet, and all compute instances in that fleet are deployed with that version. To update the AMI version, you must create a new fleet. As a best practice, we recommend replacing your managed fleets every 30 days to maintain a secure and up-to-date runtime environment for your hosted game servers. For guidance, see Security best practices for Amazon GameLift Servers. Anywhere fleet An Anywhere fleet represents compute resources that are not owned or managed by Amazon GameLift Servers. You might create an Anywhere fleet with your local machine for testing, or use one to host game servers with on-premises hardware or other game hosting solutions. To create an Anywhere fleet, provide these required parameters: ComputeType set to ANYWHERE Locations specifying a custom location Name If successful, this operation creates a new fleet resource and places it in ACTIVE status. You can register computes with a fleet in ACTIVE status. Learn more Setting up fleets Debug fleet creation issues Multi-location fleets

INSERT INTO aws.gamelift.fleets (
Name,
Description,
BuildId,
ScriptId,
ServerLaunchPath,
ServerLaunchParameters,
LogPaths,
EC2InstanceType,
EC2InboundPermissions,
NewGameSessionProtectionPolicy,
RuntimeConfiguration,
ResourceCreationLimitPolicy,
MetricGroups,
PeerVpcAwsAccountId,
PeerVpcId,
FleetType,
InstanceRoleArn,
CertificateConfiguration,
Locations,
Tags,
ComputeType,
AnywhereConfiguration,
InstanceRoleCredentialsProvider,
PlayerGatewayMode,
PlayerGatewayConfiguration,
region
)
SELECT
'{{ Name }}' /* required */,
'{{ Description }}',
'{{ BuildId }}',
'{{ ScriptId }}',
'{{ ServerLaunchPath }}',
'{{ ServerLaunchParameters }}',
'{{ LogPaths }}',
'{{ EC2InstanceType }}',
'{{ EC2InboundPermissions }}',
'{{ NewGameSessionProtectionPolicy }}',
'{{ RuntimeConfiguration }}',
'{{ ResourceCreationLimitPolicy }}',
'{{ MetricGroups }}',
'{{ PeerVpcAwsAccountId }}',
'{{ PeerVpcId }}',
'{{ FleetType }}',
'{{ InstanceRoleArn }}',
'{{ CertificateConfiguration }}',
'{{ Locations }}',
'{{ Tags }}',
'{{ ComputeType }}',
'{{ AnywhereConfiguration }}',
'{{ InstanceRoleCredentialsProvider }}',
'{{ PlayerGatewayMode }}',
'{{ PlayerGatewayConfiguration }}',
'{{ region }}'
RETURNING
fleet_attributes,
location_states
;

DELETE examples

This API works with the following fleet types: EC2, Anywhere Deletes all resources and information related to a fleet and shuts down any currently running fleet instances, including those in remote locations. If the fleet being deleted has a VPC peering connection, you first need to get a valid authorization (good for 24 hours) by calling CreateVpcPeeringAuthorization. You don't need to explicitly delete the VPC peering connection. To delete a fleet, specify the fleet ID to be terminated. During the deletion process, the fleet status is changed to DELETING. When completed, the status switches to TERMINATED and the fleet event FLEET_DELETED is emitted. Learn more Setting up Amazon GameLift Servers Fleets

DELETE FROM aws.gamelift.fleets
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

This API works with the following fleet types: EC2, Container Resumes certain types of activity on fleet instances that were suspended with StopFleetActions. For multi-location fleets, fleet actions are managed separately for each location. Currently, this operation is used to restart a fleet's auto-scaling activity. This operation can be used in the following ways: To restart actions on instances in the fleet's home Region, provide a fleet ID and the type of actions to resume. To restart actions on instances in one of the fleet's remote locations, provide a fleet ID, a location name, and the type of actions to resume. If successful, Amazon GameLift Servers once again initiates scaling events as triggered by the fleet's scaling policies. If actions on the fleet location were never stopped, this operation will have no effect. Learn more Setting up Amazon GameLift Servers fleets

EXEC aws.gamelift.fleets.start_fleet_actions
@region='{{ region }}' --required
@@json=
'{
"FleetId": "{{ FleetId }}",
"Actions": "{{ Actions }}",
"Location": "{{ Location }}"
}'
;