2019/03/07 - Amazon GameLift - 2 updated api methods
Changes Update gamelift client to latest version
{'InstanceRoleArn': 'string'}Response
{'FleetAttributes': {'InstanceRoleArn': 'string'}}
Creates a new fleet to run your game servers. A fleet is a set of Amazon Elastic Compute Cloud (Amazon EC2) instances, each of which can run multiple server processes to host game sessions. You set up a fleet to use instances with certain hardware specifications (see Amazon EC2 Instance Types), and deploy your game build to the fleet.
To create a new fleet, you must provide the following: (1) a fleet name, (2) an EC2 instance type, (3) the build ID for your game build, and (4) a run-time configuration, which specifies the server processes to run on each instance in the fleet. If fleet type is not set, the new fleet will use on-demand instances by default.
If the CreateFleet call is successful, Amazon GameLift performs the following tasks. You can track the process of a fleet by checking the fleet status or by monitoring fleet creation events:
Creates a fleet record. Status: NEW.
Begins writing events to the fleet event log, which can be accessed in the Amazon GameLift console. Sets the fleet's target capacity to 1 (desired instances), which triggers Amazon GameLift to start one new EC2 instance.
Downloads the game build to the new instance and installs it. Statuses: DOWNLOADING, VALIDATING, BUILDING.
Starts launching server processes on the instance. If the fleet is configured to run multiple server processes per instance, Amazon GameLift staggers each launch by a few seconds. Status: ACTIVATING.
Sets the fleet's status to ACTIVE as soon as one server process is ready to host a game session.
Learn more
Related operations
CreateFleet
ListFleets
DeleteFleet
Describe fleets:
DescribeFleetAttributes
DescribeFleetCapacity
DescribeFleetPortSettings
DescribeFleetUtilization
DescribeRuntimeConfiguration
DescribeEC2InstanceLimits
DescribeFleetEvents
Update fleets:
UpdateFleetAttributes
UpdateFleetCapacity
UpdateFleetPortSettings
UpdateRuntimeConfiguration
Manage fleet actions:
StartFleetActions
StopFleetActions
See also: AWS API Documentation
Request Syntax
client.create_fleet( Name='string', Description='string', BuildId='string', ServerLaunchPath='string', ServerLaunchParameters='string', LogPaths=[ 'string', ], EC2InstanceType='t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge', EC2InboundPermissions=[ { 'FromPort': 123, 'ToPort': 123, 'IpRange': 'string', 'Protocol': 'TCP'|'UDP' }, ], NewGameSessionProtectionPolicy='NoProtection'|'FullProtection', RuntimeConfiguration={ 'ServerProcesses': [ { 'LaunchPath': 'string', 'Parameters': 'string', 'ConcurrentExecutions': 123 }, ], 'MaxConcurrentGameSessionActivations': 123, 'GameSessionActivationTimeoutSeconds': 123 }, ResourceCreationLimitPolicy={ 'NewGameSessionsPerCreator': 123, 'PolicyPeriodInMinutes': 123 }, MetricGroups=[ 'string', ], PeerVpcAwsAccountId='string', PeerVpcId='string', FleetType='ON_DEMAND'|'SPOT', InstanceRoleArn='string' )
string
[REQUIRED]
Descriptive label that is associated with a fleet. Fleet names do not need to be unique.
string
Human-readable description of a fleet.
string
[REQUIRED]
Unique identifier for a build to be deployed on the new fleet. The build must have been successfully uploaded to Amazon GameLift and be in a READY status. This fleet setting cannot be changed once the fleet is created.
string
This parameter is no longer used. Instead, specify a server launch path using the RuntimeConfiguration parameter. (Requests that specify a server launch path and launch parameters instead of a run-time configuration will continue to work.)
string
This parameter is no longer used. Instead, specify server launch parameters in the RuntimeConfiguration parameter. (Requests that specify a server launch path and launch parameters instead of a run-time configuration will continue to work.)
list
This parameter is no longer used. Instead, to specify where Amazon GameLift should store log files once a server process shuts down, use the Amazon GameLift server API ProcessReady() and specify one or more directory paths in logParameters. See more information in the Server API Reference.
(string) --
string
[REQUIRED]
Name of an EC2 instance type that is supported in Amazon GameLift. A fleet instance type determines the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. Amazon GameLift supports the following EC2 instance types. See Amazon EC2 Instance Types for detailed descriptions.
list
Range of IP addresses and port settings that permit inbound traffic to access server processes running on the fleet. If no inbound permissions are set, including both IP address range and port range, the server processes in the fleet cannot accept connections. You can specify one or more sets of permissions for a fleet.
(dict) --
A range of IP addresses and port settings that allow inbound traffic to connect to server processes on Amazon GameLift. Each game session hosted on a fleet is assigned a unique combination of IP address and port number, which must fall into the fleet's allowed ranges. This combination is included in the GameSession object.
FromPort (integer) -- [REQUIRED]
Starting value for a range of allowed port numbers.
ToPort (integer) -- [REQUIRED]
Ending value for a range of allowed port numbers. Port numbers are end-inclusive. This value must be higher than FromPort.
IpRange (string) -- [REQUIRED]
Range of allowed IP addresses. This value must be expressed in CIDR notation. Example: " 000.000.000.000/[subnet mask]" or optionally the shortened version " 0.0.0.0/[subnet mask]".
Protocol (string) -- [REQUIRED]
Network communication protocol used by the fleet.
string
Game session protection policy to apply to all instances in this fleet. If this parameter is not set, instances in this fleet default to no protection. You can change a fleet's protection policy using UpdateFleetAttributes, but this change will only affect sessions created after the policy change. You can also set protection for individual instances using UpdateGameSession.
NoProtection -- The game session can be terminated during a scale-down event.
FullProtection -- If the game session is in an ACTIVE status, it cannot be terminated during a scale-down event.
dict
Instructions for launching server processes on each instance in the fleet. The run-time configuration for a fleet has a collection of server process configurations, one for each type of server process to run on an instance. A server process configuration specifies the location of the server executable, launch parameters, and the number of concurrent processes with that configuration to maintain on each instance. A CreateFleet request must include a run-time configuration with at least one server process configuration; otherwise the request fails with an invalid request exception. (This parameter replaces the parameters ServerLaunchPath and ServerLaunchParameters; requests that contain values for these parameters instead of a run-time configuration will continue to work.)
ServerProcesses (list) --
Collection of server process configurations that describe which server processes to run on each instance in a fleet.
(dict) --
A set of instructions for launching server processes on each instance in a fleet. Each instruction set identifies the location of the server executable, optional launch parameters, and the number of server processes with this configuration to maintain concurrently on the instance. Server process configurations make up a fleet's ``RuntimeConfiguration ``.
LaunchPath (string) -- [REQUIRED]
Location of the server executable in a game build. All game builds are installed on instances at the root : for Windows instances C:\game, and for Linux instances /local/game. A Windows game build with an executable file located at MyGame\latest\server.exe must have a launch path of " C:\game\MyGame\latest\server.exe". A Linux game build with an executable file located at MyGame/latest/server.exe must have a launch path of " /local/game/MyGame/latest/server.exe".
Parameters (string) --
Optional list of parameters to pass to the server executable on launch.
ConcurrentExecutions (integer) -- [REQUIRED]
Number of server processes using this configuration to run concurrently on an instance.
MaxConcurrentGameSessionActivations (integer) --
Maximum number of game sessions with status ACTIVATING to allow on an instance simultaneously. This setting limits the amount of instance resources that can be used for new game activations at any one time.
GameSessionActivationTimeoutSeconds (integer) --
Maximum amount of time (in seconds) that a game session can remain in status ACTIVATING. If the game session is not active before the timeout, activation is terminated and the game session status is changed to TERMINATED.
dict
Policy that limits the number of game sessions an individual player can create over a span of time for this fleet.
NewGameSessionsPerCreator (integer) --
Maximum number of game sessions that an individual can create during the policy period.
PolicyPeriodInMinutes (integer) --
Time span used in evaluating the resource creation limit policy.
list
Name of an Amazon CloudWatch metric group to add this fleet to. A metric group aggregates the metrics for all fleets in the group. Specify an existing metric group name, or provide a new name to create a new metric group. A fleet can only be included in one metric group at a time.
(string) --
string
Unique identifier for the AWS account with the VPC that you want to peer your Amazon GameLift fleet with. You can find your Account ID in the AWS Management Console under account settings.
string
Unique identifier for a VPC with resources to be accessed by your Amazon GameLift fleet. The VPC must be in the same region where your fleet is deployed. Look up a VPC ID using the VPC Dashboard in the AWS Management Console. Learn more about VPC peering in VPC Peering with Amazon GameLift Fleets.
string
Indicates whether to use on-demand instances or spot instances for this fleet. If empty, the default is ON_DEMAND. Both categories of instances use identical hardware and configurations, based on the instance type selected for this fleet. You can acquire on-demand instances at any time for a fixed price and keep them as long as you need them. Spot instances have lower prices, but spot pricing is variable, and while in use they can be interrupted (with a two-minute notification). Learn more about Amazon GameLift spot instances with at Set up Access to External Services.
string
Unique identifier for an AWS IAM role that manages access to your AWS services. Any application that runs on an instance in this fleet can assume the role, including install scripts, server processs, daemons (background processes). Create a role or look up a role's ARN using the IAM dashboard in the AWS Management Console. Learn more about using on-box credentials for your game servers at Access external resources from a game server.
dict
Response Syntax
{ 'FleetAttributes': { 'FleetId': 'string', 'FleetArn': 'string', 'FleetType': 'ON_DEMAND'|'SPOT', 'InstanceType': 't2.micro'|'t2.small'|'t2.medium'|'t2.large'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge', 'Description': 'string', 'Name': 'string', 'CreationTime': datetime(2015, 1, 1), 'TerminationTime': datetime(2015, 1, 1), 'Status': 'NEW'|'DOWNLOADING'|'VALIDATING'|'BUILDING'|'ACTIVATING'|'ACTIVE'|'DELETING'|'ERROR'|'TERMINATED', 'BuildId': 'string', 'ServerLaunchPath': 'string', 'ServerLaunchParameters': 'string', 'LogPaths': [ 'string', ], 'NewGameSessionProtectionPolicy': 'NoProtection'|'FullProtection', 'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX', 'ResourceCreationLimitPolicy': { 'NewGameSessionsPerCreator': 123, 'PolicyPeriodInMinutes': 123 }, 'MetricGroups': [ 'string', ], 'StoppedActions': [ 'AUTO_SCALING', ], 'InstanceRoleArn': 'string' } }
Response Structure
(dict) --
Represents the returned data in response to a request action.
FleetAttributes (dict) --
Properties for the newly created fleet.
FleetId (string) --
Unique identifier for a fleet.
FleetArn (string) --
Identifier for a fleet that is unique across all regions.
FleetType (string) --
Indicates whether the fleet uses on-demand or spot instances. A spot instance in use may be interrupted with a two-minute notification.
InstanceType (string) --
EC2 instance type indicating the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. See Amazon EC2 Instance Types for detailed descriptions.
Description (string) --
Human-readable description of the fleet.
Name (string) --
Descriptive label that is associated with a fleet. Fleet names do not need to be unique.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
Status (string) --
Current status of the fleet.
Possible fleet statuses include the following:
NEW -- A new fleet has been defined and desired instances is set to 1.
DOWNLOADING/VALIDATING/BUILDING/ACTIVATING -- Amazon GameLift is setting up the new fleet, creating new instances with the game build and starting server processes.
ACTIVE -- Hosts can now accept game sessions.
ERROR -- An error occurred when downloading, validating, building, or activating the fleet.
DELETING -- Hosts are responding to a delete fleet request.
TERMINATED -- The fleet no longer exists.
BuildId (string) --
Unique identifier for a build.
ServerLaunchPath (string) --
Path to a game server executable in the fleet's build, specified for fleets created before 2016-08-04 (or AWS SDK v. 0.12.16). Server launch paths for fleets created after this date are specified in the fleet's RuntimeConfiguration.
ServerLaunchParameters (string) --
Game server launch parameters specified for fleets created before 2016-08-04 (or AWS SDK v. 0.12.16). Server launch parameters for fleets created after this date are specified in the fleet's RuntimeConfiguration.
LogPaths (list) --
Location of default log files. When a server process is shut down, Amazon GameLift captures and stores any log files in this location. These logs are in addition to game session logs; see more on game session logs in the Amazon GameLift Developer Guide. If no default log path for a fleet is specified, Amazon GameLift automatically uploads logs that are stored on each instance at C:\game\logs (for Windows) or /local/game/logs (for Linux). Use the Amazon GameLift console to access stored logs.
(string) --
NewGameSessionProtectionPolicy (string) --
Type of game session protection to set for all new instances started in the fleet.
NoProtection -- The game session can be terminated during a scale-down event.
FullProtection -- If the game session is in an ACTIVE status, it cannot be terminated during a scale-down event.
OperatingSystem (string) --
Operating system of the fleet's computing resources. A fleet's operating system depends on the OS specified for the build that is deployed on this fleet.
ResourceCreationLimitPolicy (dict) --
Fleet policy to limit the number of game sessions an individual player can create over a span of time.
NewGameSessionsPerCreator (integer) --
Maximum number of game sessions that an individual can create during the policy period.
PolicyPeriodInMinutes (integer) --
Time span used in evaluating the resource creation limit policy.
MetricGroups (list) --
Names of metric groups that this fleet is included in. In Amazon CloudWatch, you can view metrics for an individual fleet or aggregated metrics for fleets that are in a fleet metric group. A fleet can be included in only one metric group at a time.
(string) --
StoppedActions (list) --
List of fleet actions that have been suspended using StopFleetActions. This includes auto-scaling.
(string) --
InstanceRoleArn (string) --
Unique identifier for an AWS IAM role that manages access to your AWS services. Any application that runs on an instance in this fleet can assume the role, including install scripts, server processs, daemons (background processes). Create a role or look up a role's ARN using the IAM dashboard in the AWS Management Console. Learn more about using on-box credentials for your game servers at Access external resources from a game server.
{'FleetAttributes': {'InstanceRoleArn': 'string'}}
Retrieves fleet properties, including metadata, status, and configuration, for one or more fleets. You can request attributes for all fleets, or specify a list of one or more fleet IDs. When requesting multiple fleets, use the pagination parameters to retrieve results as a set of sequential pages. If successful, a FleetAttributes object is returned for each requested fleet ID. When specifying a list of fleet IDs, attribute objects are returned only for fleets that currently exist.
Learn more
Related operations
CreateFleet
ListFleets
DeleteFleet
Describe fleets:
DescribeFleetAttributes
DescribeFleetCapacity
DescribeFleetPortSettings
DescribeFleetUtilization
DescribeRuntimeConfiguration
DescribeEC2InstanceLimits
DescribeFleetEvents
Update fleets:
UpdateFleetAttributes
UpdateFleetCapacity
UpdateFleetPortSettings
UpdateRuntimeConfiguration
Manage fleet actions:
StartFleetActions
StopFleetActions
See also: AWS API Documentation
Request Syntax
client.describe_fleet_attributes( FleetIds=[ 'string', ], Limit=123, NextToken='string' )
list
Unique identifier for a fleet(s) to retrieve attributes for. To request attributes for all fleets, leave this parameter empty.
(string) --
integer
Maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages. This parameter is ignored when the request specifies one or a list of fleet IDs.
string
Token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To start at the beginning of the result set, do not specify a value. This parameter is ignored when the request specifies one or a list of fleet IDs.
dict
Response Syntax
{ 'FleetAttributes': [ { 'FleetId': 'string', 'FleetArn': 'string', 'FleetType': 'ON_DEMAND'|'SPOT', 'InstanceType': 't2.micro'|'t2.small'|'t2.medium'|'t2.large'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge', 'Description': 'string', 'Name': 'string', 'CreationTime': datetime(2015, 1, 1), 'TerminationTime': datetime(2015, 1, 1), 'Status': 'NEW'|'DOWNLOADING'|'VALIDATING'|'BUILDING'|'ACTIVATING'|'ACTIVE'|'DELETING'|'ERROR'|'TERMINATED', 'BuildId': 'string', 'ServerLaunchPath': 'string', 'ServerLaunchParameters': 'string', 'LogPaths': [ 'string', ], 'NewGameSessionProtectionPolicy': 'NoProtection'|'FullProtection', 'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX', 'ResourceCreationLimitPolicy': { 'NewGameSessionsPerCreator': 123, 'PolicyPeriodInMinutes': 123 }, 'MetricGroups': [ 'string', ], 'StoppedActions': [ 'AUTO_SCALING', ], 'InstanceRoleArn': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Represents the returned data in response to a request action.
FleetAttributes (list) --
Collection of objects containing attribute metadata for each requested fleet ID.
(dict) --
General properties describing a fleet.
CreateFleet
ListFleets
DeleteFleet
Describe fleets:
DescribeFleetAttributes
DescribeFleetCapacity
DescribeFleetPortSettings
DescribeFleetUtilization
DescribeRuntimeConfiguration
DescribeEC2InstanceLimits
DescribeFleetEvents
Update fleets:
UpdateFleetAttributes
UpdateFleetCapacity
UpdateFleetPortSettings
UpdateRuntimeConfiguration
Manage fleet actions:
StartFleetActions
StopFleetActions
FleetId (string) --
Unique identifier for a fleet.
FleetArn (string) --
Identifier for a fleet that is unique across all regions.
FleetType (string) --
Indicates whether the fleet uses on-demand or spot instances. A spot instance in use may be interrupted with a two-minute notification.
InstanceType (string) --
EC2 instance type indicating the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. See Amazon EC2 Instance Types for detailed descriptions.
Description (string) --
Human-readable description of the fleet.
Name (string) --
Descriptive label that is associated with a fleet. Fleet names do not need to be unique.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
Status (string) --
Current status of the fleet.
Possible fleet statuses include the following:
NEW -- A new fleet has been defined and desired instances is set to 1.
DOWNLOADING/VALIDATING/BUILDING/ACTIVATING -- Amazon GameLift is setting up the new fleet, creating new instances with the game build and starting server processes.
ACTIVE -- Hosts can now accept game sessions.
ERROR -- An error occurred when downloading, validating, building, or activating the fleet.
DELETING -- Hosts are responding to a delete fleet request.
TERMINATED -- The fleet no longer exists.
BuildId (string) --
Unique identifier for a build.
ServerLaunchPath (string) --
Path to a game server executable in the fleet's build, specified for fleets created before 2016-08-04 (or AWS SDK v. 0.12.16). Server launch paths for fleets created after this date are specified in the fleet's RuntimeConfiguration.
ServerLaunchParameters (string) --
Game server launch parameters specified for fleets created before 2016-08-04 (or AWS SDK v. 0.12.16). Server launch parameters for fleets created after this date are specified in the fleet's RuntimeConfiguration.
LogPaths (list) --
Location of default log files. When a server process is shut down, Amazon GameLift captures and stores any log files in this location. These logs are in addition to game session logs; see more on game session logs in the Amazon GameLift Developer Guide. If no default log path for a fleet is specified, Amazon GameLift automatically uploads logs that are stored on each instance at C:\game\logs (for Windows) or /local/game/logs (for Linux). Use the Amazon GameLift console to access stored logs.
(string) --
NewGameSessionProtectionPolicy (string) --
Type of game session protection to set for all new instances started in the fleet.
NoProtection -- The game session can be terminated during a scale-down event.
FullProtection -- If the game session is in an ACTIVE status, it cannot be terminated during a scale-down event.
OperatingSystem (string) --
Operating system of the fleet's computing resources. A fleet's operating system depends on the OS specified for the build that is deployed on this fleet.
ResourceCreationLimitPolicy (dict) --
Fleet policy to limit the number of game sessions an individual player can create over a span of time.
NewGameSessionsPerCreator (integer) --
Maximum number of game sessions that an individual can create during the policy period.
PolicyPeriodInMinutes (integer) --
Time span used in evaluating the resource creation limit policy.
MetricGroups (list) --
Names of metric groups that this fleet is included in. In Amazon CloudWatch, you can view metrics for an individual fleet or aggregated metrics for fleets that are in a fleet metric group. A fleet can be included in only one metric group at a time.
(string) --
StoppedActions (list) --
List of fleet actions that have been suspended using StopFleetActions. This includes auto-scaling.
(string) --
InstanceRoleArn (string) --
Unique identifier for an AWS IAM role that manages access to your AWS services. Any application that runs on an instance in this fleet can assume the role, including install scripts, server processs, daemons (background processes). Create a role or look up a role's ARN using the IAM dashboard in the AWS Management Console. Learn more about using on-box credentials for your game servers at Access external resources from a game server.
NextToken (string) --
Token that indicates where to resume retrieving results on the next call to this action. If no token is returned, these results represent the end of the list.