Amazon GameLift

2019/12/19 - Amazon GameLift - 3 new30 updated api methods

Changes  Update gamelift client to latest version

TagResource (new) Link ¶

Assigns a tag to a GameLift resource. AWS resource tags provide an additional management tool set. You can use tags to organize resources, create IAM permissions policies to manage access to groups of resources, customize AWS cost breakdowns, etc. This action handles the permissions necessary to manage tags for the following GameLift resource types:

  • Build

  • Script

  • Fleet

  • Alias

  • GameSessionQueue

  • MatchmakingConfiguration

  • MatchmakingRuleSet

To add a tag to a resource, specify the unique ARN value for the resource and provide a trig list containing one or more tags. The operation succeeds even if the list includes tags that are already assigned to the specified resource.

Learn more

Tagging AWS Resources in the AWS General Reference

AWS Tagging Strategies

Related operations

  • TagResource

  • UntagResource

  • ListTagsForResource

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    ResourceARN='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type ResourceARN:

string

param ResourceARN:

[REQUIRED]

The Amazon Resource Name ( ARN) that is assigned to and uniquely identifies the GameLift resource that you want to assign tags to. GameLift resource ARNs are included in the data object for the resource, which can be retrieved by calling a List or Describe action for the resource type.

type Tags:

list

param Tags:

[REQUIRED]

A list of one or more tags to assign to the specified GameLift resource. Tags are developer-defined and structured as key-value pairs. The maximum tag limit may be lower than stated. See Tagging AWS Resources for actual tagging limits.

  • (dict) --

    A label that can be assigned to a GameLift resource.

    Learn more

    Tagging AWS Resources in the AWS General Reference

    AWS Tagging Strategies

    Related operations

    • TagResource

    • UntagResource

    • ListTagsForResource

    • Key (string) -- [REQUIRED]

      The key for a developer-defined key:value pair for tagging an AWS resource.

    • Value (string) -- [REQUIRED]

      The value for a developer-defined key:value pair for tagging an AWS resource.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

UntagResource (new) Link ¶

Removes a tag that is assigned to a GameLift resource. Resource tags are used to organize AWS resources for a range of purposes. This action handles the permissions necessary to manage tags for the following GameLift resource types:

  • Build

  • Script

  • Fleet

  • Alias

  • GameSessionQueue

  • MatchmakingConfiguration

  • MatchmakingRuleSet

To remove a tag from a resource, specify the unique ARN value for the resource and provide a string list containing one or more tags to be removed. This action succeeds even if the list includes tags that are not currently assigned to the specified resource.

Learn more

Tagging AWS Resources in the AWS General Reference

AWS Tagging Strategies

Related operations

  • TagResource

  • UntagResource

  • ListTagsForResource

See also: AWS API Documentation

Request Syntax

client.untag_resource(
    ResourceARN='string',
    TagKeys=[
        'string',
    ]
)
type ResourceARN:

string

param ResourceARN:

[REQUIRED]

The Amazon Resource Name ( ARN) that is assigned to and uniquely identifies the GameLift resource that you want to remove tags from. GameLift resource ARNs are included in the data object for the resource, which can be retrieved by calling a List or Describe action for the resource type.

type TagKeys:

list

param TagKeys:

[REQUIRED]

A list of one or more tags to remove from the specified GameLift resource. Tags are developer-defined and structured as key-value pairs.

  • (string) --

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

ListTagsForResource (new) Link ¶

Retrieves all tags that are assigned to a GameLift resource. Resource tags are used to organize AWS resources for a range of purposes. This action handles the permissions necessary to manage tags for the following GameLift resource types:

  • Build

  • Script

  • Fleet

  • Alias

  • GameSessionQueue

  • MatchmakingConfiguration

  • MatchmakingRuleSet

To list tags for a resource, specify the unique ARN value for the resource.

Learn more

Tagging AWS Resources in the AWS General Reference

AWS Tagging Strategies

Related operations

  • TagResource

  • UntagResource

  • ListTagsForResource

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    ResourceARN='string'
)
type ResourceARN:

string

param ResourceARN:

[REQUIRED]

The Amazon Resource Name ( ARN) that is assigned to and uniquely identifies the GameLift resource that you want to retrieve tags for. GameLift resource ARNs are included in the data object for the resource, which can be retrieved by calling a List or Describe action for the resource type.

rtype:

dict

returns:

Response Syntax

{
    'Tags': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Tags (list) --

      The collection of tags that have been assigned to the specified resource.

      • (dict) --

        A label that can be assigned to a GameLift resource.

        Learn more

        Tagging AWS Resources in the AWS General Reference

        AWS Tagging Strategies

        Related operations

        • TagResource

        • UntagResource

        • ListTagsForResource

        • Key (string) --

          The key for a developer-defined key:value pair for tagging an AWS resource.

        • Value (string) --

          The value for a developer-defined key:value pair for tagging an AWS resource.

CreateAlias (updated) Link ¶
Changes (request)
{'Tags': [{'Key': 'string', 'Value': 'string'}]}

Creates an alias for a fleet. In most situations, you can use an alias ID in place of a fleet ID. An alias provides a level of abstraction for a fleet that is useful when redirecting player traffic from one fleet to another, such as when updating your game build.

Amazon GameLift supports two types of routing strategies for aliases: simple and terminal. A simple alias points to an active fleet. A terminal alias is used to display messaging or link to a URL instead of routing players to an active fleet. For example, you might use a terminal alias when a game version is no longer supported and you want to direct players to an upgrade site.

To create a fleet alias, specify an alias name, routing strategy, and optional description. Each simple alias can point to only one fleet, but a fleet can have multiple aliases. If successful, a new alias record is returned, including an alias ID and an ARN. You can reassign an alias to another fleet by calling UpdateAlias.

  • CreateAlias

  • ListAliases

  • DescribeAlias

  • UpdateAlias

  • DeleteAlias

  • ResolveAlias

See also: AWS API Documentation

Request Syntax

client.create_alias(
    Name='string',
    Description='string',
    RoutingStrategy={
        'Type': 'SIMPLE'|'TERMINAL',
        'FleetId': 'string',
        'Message': 'string'
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Name:

string

param Name:

[REQUIRED]

A descriptive label that is associated with an alias. Alias names do not need to be unique.

type Description:

string

param Description:

A human-readable description of the alias.

type RoutingStrategy:

dict

param RoutingStrategy:

[REQUIRED]

The routing configuration, including routing type and fleet target, for the alias.

  • Type (string) --

    The type of routing strategy for the alias.

    Possible routing types include the following:

    • SIMPLE - The alias resolves to one specific fleet. Use this type when routing to active fleets.

    • TERMINAL - The alias does not resolve to a fleet but instead can be used to display a message to the user. A terminal alias throws a TerminalRoutingStrategyException with the RoutingStrategy message embedded.

  • FleetId (string) --

    The unique identifier for a fleet that the alias points to. This value is the fleet ID, not the fleet ARN.

  • Message (string) --

    The message text to be used with a terminal routing strategy.

type Tags:

list

param Tags:

A list of labels to assign to the new alias resource. Tags are developer-defined key-value pairs. Tagging AWS resources are useful for resource management, access management and cost allocation. For more information, see Tagging AWS Resources in the AWS General Reference. Once the resource is created, you can use TagResource, UntagResource, and ListTagsForResource to add, remove, and view tags. The maximum tag limit may be lower than stated. See the AWS General Reference for actual tagging limits.

  • (dict) --

    A label that can be assigned to a GameLift resource.

    Learn more

    Tagging AWS Resources in the AWS General Reference

    AWS Tagging Strategies

    Related operations

    • TagResource

    • UntagResource

    • ListTagsForResource

    • Key (string) -- [REQUIRED]

      The key for a developer-defined key:value pair for tagging an AWS resource.

    • Value (string) -- [REQUIRED]

      The value for a developer-defined key:value pair for tagging an AWS resource.

rtype:

dict

returns:

Response Syntax

{
    'Alias': {
        'AliasId': 'string',
        'Name': 'string',
        'AliasArn': 'string',
        'Description': 'string',
        'RoutingStrategy': {
            'Type': 'SIMPLE'|'TERMINAL',
            'FleetId': 'string',
            'Message': 'string'
        },
        'CreationTime': datetime(2015, 1, 1),
        'LastUpdatedTime': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • Alias (dict) --

      The newly created alias resource.

      • AliasId (string) --

        A unique identifier for an alias. Alias IDs are unique within a Region.

      • Name (string) --

        A descriptive label that is associated with an alias. Alias names do not need to be unique.

      • AliasArn (string) --

        Amazon Resource Name ( ARN) that is assigned to a GameLift alias resource and uniquely identifies it. ARNs are unique across all Regions.. In a GameLift alias ARN, the resource ID matches the alias ID value.

      • Description (string) --

        A human-readable description of an alias.

      • RoutingStrategy (dict) --

        The routing configuration, including routing type and fleet target, for the alias.

        • Type (string) --

          The type of routing strategy for the alias.

          Possible routing types include the following:

          • SIMPLE - The alias resolves to one specific fleet. Use this type when routing to active fleets.

          • TERMINAL - The alias does not resolve to a fleet but instead can be used to display a message to the user. A terminal alias throws a TerminalRoutingStrategyException with the RoutingStrategy message embedded.

        • FleetId (string) --

          The unique identifier for a fleet that the alias points to. This value is the fleet ID, not the fleet ARN.

        • Message (string) --

          The message text to be used with a terminal routing strategy.

      • CreationTime (datetime) --

        A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • LastUpdatedTime (datetime) --

        The time that this data object was last modified. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

CreateBuild (updated) Link ¶
Changes (request, response)
Request
{'Tags': [{'Key': 'string', 'Value': 'string'}]}
Response
{'Build': {'BuildArn': 'string'}}

Creates a new Amazon GameLift build record for your game server binary files and points to the location of your game server build files in an Amazon Simple Storage Service (Amazon S3) location.

Game server binaries must be combined into a zip file for use with Amazon GameLift.

The CreateBuild operation should be used only in the following scenarios:

  • To create a new game build with build files that are in an Amazon S3 bucket under your own AWS account. To use this option, you must first give Amazon GameLift access to that Amazon S3 bucket. Then call CreateBuild and specify a build name, operating system, and the Amazon S3 storage location of your game build.

  • To upload build files directly to Amazon GameLift's Amazon S3 account. To use this option, first call CreateBuild and specify a build name and operating system. This action creates a new build record and returns an Amazon S3 storage location (bucket and key only) and temporary access credentials. Use the credentials to manually upload your build file to the provided storage location (see the Amazon S3 topic Uploading Objects). You can upload build files to the GameLift Amazon S3 location only once.

If successful, this operation creates a new build record with a unique build ID and places it in INITIALIZED status. You can use DescribeBuild to check the status of your build. A build must be in READY status before it can be used to create fleets.

Learn more

Uploading Your Game https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html

Create a Build with Files in Amazon S3

Related operations

  • CreateBuild

  • ListBuilds

  • DescribeBuild

  • UpdateBuild

  • DeleteBuild

See also: AWS API Documentation

Request Syntax

client.create_build(
    Name='string',
    Version='string',
    StorageLocation={
        'Bucket': 'string',
        'Key': 'string',
        'RoleArn': 'string',
        'ObjectVersion': 'string'
    },
    OperatingSystem='WINDOWS_2012'|'AMAZON_LINUX'|'AMAZON_LINUX_2',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Name:

string

param Name:

A descriptive label that is associated with a build. Build names do not need to be unique. You can use UpdateBuild to change this value later.

type Version:

string

param Version:

Version information that is associated with a build or script. Version strings do not need to be unique. You can use UpdateBuild to change this value later.

type StorageLocation:

dict

param StorageLocation:

Information indicating where your game build files are stored. Use this parameter only when creating a build with files stored in an Amazon S3 bucket that you own. The storage location must specify an Amazon S3 bucket name and key. The location must also specify a role ARN that you set up to allow Amazon GameLift to access your Amazon S3 bucket. The S3 bucket and your new build must be in the same Region.

  • Bucket (string) --

    An Amazon S3 bucket identifier. This is the name of the S3 bucket.

  • Key (string) --

    The name of the zip file that contains the build files or script files.

  • RoleArn (string) --

    The Amazon Resource Name ( ARN) for an IAM role that allows Amazon GameLift to access the S3 bucket.

  • ObjectVersion (string) --

    The version of the file, if object versioning is turned on for the bucket. Amazon GameLift uses this information when retrieving files from an S3 bucket that you own. Use this parameter to specify a specific version of the file. If not set, the latest version of the file is retrieved.

type OperatingSystem:

string

param OperatingSystem:

The operating system that the game server binaries are built to run on. This value determines the type of fleet resources that you can use for this build. If your game build contains multiple executables, they all must run on the same operating system. If an operating system is not specified when creating a build, Amazon GameLift uses the default value (WINDOWS_2012). This value cannot be changed later.

type Tags:

list

param Tags:

A list of labels to assign to the new build resource. Tags are developer-defined key-value pairs. Tagging AWS resources are useful for resource management, access management and cost allocation. For more information, see Tagging AWS Resources in the AWS General Reference. Once the resource is created, you can use TagResource, UntagResource, and ListTagsForResource to add, remove, and view tags. The maximum tag limit may be lower than stated. See the AWS General Reference for actual tagging limits.

  • (dict) --

    A label that can be assigned to a GameLift resource.

    Learn more

    Tagging AWS Resources in the AWS General Reference

    AWS Tagging Strategies

    Related operations

    • TagResource

    • UntagResource

    • ListTagsForResource

    • Key (string) -- [REQUIRED]

      The key for a developer-defined key:value pair for tagging an AWS resource.

    • Value (string) -- [REQUIRED]

      The value for a developer-defined key:value pair for tagging an AWS resource.

rtype:

dict

returns:

Response Syntax

{
    'Build': {
        'BuildId': 'string',
        'BuildArn': 'string',
        'Name': 'string',
        'Version': 'string',
        'Status': 'INITIALIZED'|'READY'|'FAILED',
        'SizeOnDisk': 123,
        'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX'|'AMAZON_LINUX_2',
        'CreationTime': datetime(2015, 1, 1)
    },
    'UploadCredentials': {
        'AccessKeyId': 'string',
        'SecretAccessKey': 'string',
        'SessionToken': 'string'
    },
    'StorageLocation': {
        'Bucket': 'string',
        'Key': 'string',
        'RoleArn': 'string',
        'ObjectVersion': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • Build (dict) --

      The newly created build record, including a unique build IDs and status.

      • BuildId (string) --

        A unique identifier for a build.

      • BuildArn (string) --

        Amazon Resource Name ( ARN) that is assigned to a GameLift build resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift build ARN, the resource ID matches the BuildId value.

      • Name (string) --

        A descriptive label that is associated with a build. Build names do not need to be unique. It can be set using CreateBuild or UpdateBuild.

      • Version (string) --

        Version information that is associated with a build or script. Version strings do not need to be unique. This value can be set using CreateBuild or UpdateBuild.

      • Status (string) --

        Current status of the build.

        Possible build statuses include the following:

        • INITIALIZED -- A new build has been defined, but no files have been uploaded. You cannot create fleets for builds that are in this status. When a build is successfully created, the build status is set to this value.

        • READY -- The game build has been successfully uploaded. You can now create new fleets for this build.

        • FAILED -- The game build upload failed. You cannot create new fleets for this build.

      • SizeOnDisk (integer) --

        File size of the uploaded game build, expressed in bytes. When the build status is INITIALIZED, this value is 0.

      • OperatingSystem (string) --

        Operating system that the game server binaries are built to run on. This value determines the type of fleet resources that you can use for this build.

      • 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").

    • UploadCredentials (dict) --

      This element is returned only when the operation is called without a storage location. It contains credentials to use when you are uploading a build file to an Amazon S3 bucket that is owned by Amazon GameLift. Credentials have a limited life span. To refresh these credentials, call RequestUploadCredentials.

      • AccessKeyId (string) --

        Temporary key allowing access to the Amazon GameLift S3 account.

      • SecretAccessKey (string) --

        Temporary secret key allowing access to the Amazon GameLift S3 account.

      • SessionToken (string) --

        Token used to associate a specific build ID with the files uploaded using these credentials.

    • StorageLocation (dict) --

      Amazon S3 location for your game build file, including bucket name and key.

      • Bucket (string) --

        An Amazon S3 bucket identifier. This is the name of the S3 bucket.

      • Key (string) --

        The name of the zip file that contains the build files or script files.

      • RoleArn (string) --

        The Amazon Resource Name ( ARN) for an IAM role that allows Amazon GameLift to access the S3 bucket.

      • ObjectVersion (string) --

        The version of the file, if object versioning is turned on for the bucket. Amazon GameLift uses this information when retrieving files from an S3 bucket that you own. Use this parameter to specify a specific version of the file. If not set, the latest version of the file is retrieved.

CreateFleet (updated) Link ¶
Changes (request, response)
Request
{'Tags': [{'Key': 'string', 'Value': 'string'}]}
Response
{'FleetAttributes': {'BuildArn': 'string', 'ScriptArn': 'string'}}

Creates a new fleet to run your game servers. whether they are custom game builds or Realtime Servers with game-specific script. A fleet is a set of Amazon Elastic Compute Cloud (Amazon EC2) instances, each of which can host multiple game sessions. When creating a fleet, you choose the hardware specifications, set some configuration options, and specify the game server to deploy on the new fleet.

To create a new fleet, you must provide the following: (1) a fleet name, (2) an EC2 instance type and fleet type (spot or on-demand), (3) the build ID for your game build or script ID if using Realtime Servers, and (4) a runtime configuration, which determines how game servers will run on each instance in the fleet.

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 or Realtime script 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 process 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

Setting Up Fleets

Debug Fleet Creation Issues

Related operations

  • CreateFleet

  • ListFleets

  • DeleteFleet

  • DescribeFleetAttributes

  • UpdateFleetAttributes

  • Manage fleet actions:

    • StartFleetActions

    • StopFleetActions

See also: AWS API Documentation

Request Syntax

client.create_fleet(
    Name='string',
    Description='string',
    BuildId='string',
    ScriptId='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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge',
    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',
    CertificateConfiguration={
        'CertificateType': 'DISABLED'|'GENERATED'
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Name:

string

param Name:

[REQUIRED]

A descriptive label that is associated with a fleet. Fleet names do not need to be unique.

type Description:

string

param Description:

A human-readable description of a fleet.

type BuildId:

string

param BuildId:

A unique identifier for a build to be deployed on the new fleet. You can use either the build ID or ARN value. The custom game server 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.

type ScriptId:

string

param ScriptId:

A unique identifier for a Realtime script to be deployed on the new fleet. You can use either the script ID or ARN value. The Realtime script must have been successfully uploaded to Amazon GameLift. This fleet setting cannot be changed once the fleet is created.

type ServerLaunchPath:

string

param ServerLaunchPath:

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 runtime configuration will continue to work.

type ServerLaunchParameters:

string

param ServerLaunchParameters:

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 runtime configuration will continue to work.)

type LogPaths:

list

param LogPaths:

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) --

type EC2InstanceType:

string

param EC2InstanceType:

[REQUIRED]

The 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.

type EC2InboundPermissions:

list

param EC2InboundPermissions:

Range of IP addresses and port settings that permit inbound traffic to access game sessions that are running on the fleet. For fleets using a custom game build, this parameter is required before game sessions running on the fleet can accept connections. For Realtime Servers fleets, Amazon GameLift automatically sets TCP and UDP ranges for use by the Realtime servers. You can specify multiple permission settings or add more by updating the fleet.

  • (dict) --

    A range of IP addresses and port settings that allow inbound traffic to connect to server processes on an Amazon GameLift hosting resource. New game sessions that are started on the fleet are assigned an IP address/port number combination, which must fall into the fleet's allowed ranges. For fleets created with a custom game server, the ranges reflect the server's game session assignments. For Realtime Servers fleets, Amazon GameLift automatically opens two port ranges, one for TCP messaging and one for UDP for use by the Realtime servers.

    • FromPort (integer) -- [REQUIRED]

      A starting value for a range of allowed port numbers.

    • ToPort (integer) -- [REQUIRED]

      An ending value for a range of allowed port numbers. Port numbers are end-inclusive. This value must be higher than FromPort.

    • IpRange (string) -- [REQUIRED]

      A 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]

      The network communication protocol used by the fleet.

type NewGameSessionProtectionPolicy:

string

param NewGameSessionProtectionPolicy:

A 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.

type RuntimeConfiguration:

dict

param RuntimeConfiguration:

Instructions for launching server processes on each instance in the fleet. Server processes run either a custom game build executable or a Realtime script. The runtime configuration defines the server executables or launch script file, launch parameters, and the number of processes to run concurrently on each instance. When creating a fleet, the runtime configuration must have at least one server process configuration; otherwise the request fails with an invalid request exception. (This parameter replaces the parameters ServerLaunchPath and ServerLaunchParameters, although requests that contain values for these parameters instead of a runtime configuration will continue to work.) This parameter is required unless the parameters ServerLaunchPath and ServerLaunchParameters are defined. Runtime configuration replaced these parameters, but fleets that use them will continue to work.

  • ServerProcesses (list) --

    A 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. Server processes run either a custom game build executable or a Realtime Servers script. Each instruction set identifies the location of the custom game build executable or Realtime launch script, 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]

        The location of the server executable in a custom game build or the name of the Realtime script file that contains the Init() function. Game builds and Realtime scripts are installed on instances at the root:

        • Windows (for custom game builds only): C:\game. Example: " C:\game\MyGame\server.exe"

        • Linux: /local/game. Examples: " /local/game/MyGame/server.exe" or " /local/game/MyRealtimeScript.js"

      • Parameters (string) --

        An optional list of parameters to pass to the server executable or Realtime script on launch.

      • ConcurrentExecutions (integer) -- [REQUIRED]

        The number of server processes that use this configuration to run concurrently on an instance.

  • MaxConcurrentGameSessionActivations (integer) --

    The 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) --

    The 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.

type ResourceCreationLimitPolicy:

dict

param ResourceCreationLimitPolicy:

A policy that limits the number of game sessions an individual player can create over a span of time for this fleet.

  • NewGameSessionsPerCreator (integer) --

    The maximum number of game sessions that an individual can create during the policy period.

  • PolicyPeriodInMinutes (integer) --

    The time span used in evaluating the resource creation limit policy.

type MetricGroups:

list

param MetricGroups:

The 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) --

type PeerVpcAwsAccountId:

string

param PeerVpcAwsAccountId:

A 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.

type PeerVpcId:

string

param PeerVpcId:

A unique identifier for a VPC with resources to be accessed by your Amazon GameLift fleet. The VPC must be in the same Region as your fleet. To look up a VPC ID, use the VPC Dashboard in the AWS Management Console. Learn more about VPC peering in VPC Peering with Amazon GameLift Fleets.

type FleetType:

string

param FleetType:

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. Learn more about On-Demand versus Spot Instances.

type InstanceRoleArn:

string

param InstanceRoleArn:

A unique identifier for an AWS IAM role that manages access to your AWS services. With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes). Create a role or look up a role's ARN from 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.

type CertificateConfiguration:

dict

param CertificateConfiguration:

Indicates whether to generate a TLS/SSL certificate for the new fleet. TLS certificates are used for encrypting traffic between game clients and game servers running on GameLift. If this parameter is not specified, the default value, DISABLED, is used. This fleet setting cannot be changed once the fleet is created. Learn more at Securing Client/Server Communication.

Note: This feature requires the AWS Certificate Manager (ACM) service, which is available in the AWS global partition but not in all other partitions. When working in a partition that does not support this feature, a request for a new fleet with certificate generation results fails with a 4xx unsupported Region error.

Valid values include:

  • GENERATED - Generate a TLS/SSL certificate for this fleet.

  • DISABLED - (default) Do not generate a TLS/SSL certificate for this fleet.

  • CertificateType (string) -- [REQUIRED]

    Indicates whether a TLS/SSL certificate was generated for a fleet.

type Tags:

list

param Tags:

A list of labels to assign to the new fleet resource. Tags are developer-defined key-value pairs. Tagging AWS resources are useful for resource management, access management and cost allocation. For more information, see Tagging AWS Resources in the AWS General Reference. Once the resource is created, you can use TagResource, UntagResource, and ListTagsForResource to add, remove, and view tags. The maximum tag limit may be lower than stated. See the AWS General Reference for actual tagging limits.

  • (dict) --

    A label that can be assigned to a GameLift resource.

    Learn more

    Tagging AWS Resources in the AWS General Reference

    AWS Tagging Strategies

    Related operations

    • TagResource

    • UntagResource

    • ListTagsForResource

    • Key (string) -- [REQUIRED]

      The key for a developer-defined key:value pair for tagging an AWS resource.

    • Value (string) -- [REQUIRED]

      The value for a developer-defined key:value pair for tagging an AWS resource.

rtype:

dict

returns:

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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge',
        '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',
        'BuildArn': 'string',
        'ScriptId': 'string',
        'ScriptArn': 'string',
        'ServerLaunchPath': 'string',
        'ServerLaunchParameters': 'string',
        'LogPaths': [
            'string',
        ],
        'NewGameSessionProtectionPolicy': 'NoProtection'|'FullProtection',
        'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX'|'AMAZON_LINUX_2',
        'ResourceCreationLimitPolicy': {
            'NewGameSessionsPerCreator': 123,
            'PolicyPeriodInMinutes': 123
        },
        'MetricGroups': [
            'string',
        ],
        'StoppedActions': [
            'AUTO_SCALING',
        ],
        'InstanceRoleArn': 'string',
        'CertificateConfiguration': {
            'CertificateType': 'DISABLED'|'GENERATED'
        }
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • FleetAttributes (dict) --

      Properties for the newly created fleet.

      • FleetId (string) --

        A unique identifier for a fleet.

      • FleetArn (string) --

        The Amazon Resource Name ( ARN) that is assigned to a GameLift fleet resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift fleet ARN, the resource ID matches the FleetId value.

      • 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) --

        A 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 or Realtime script 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) --

        A unique identifier for a build.

      • BuildArn (string) --

        The Amazon Resource Name ( ARN) associated with the GameLift build resource that is deployed on instances in this fleet. In a GameLift build ARN, the resource ID matches the BuildId value.

      • ScriptId (string) --

        A unique identifier for a Realtime script.

      • ScriptArn (string) --

        The Amazon Resource Name ( ARN) associated with the GameLift script resource that is deployed on instances in this fleet. In a GameLift script ARN, the resource ID matches the ScriptId value.

      • 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) --

        The 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) --

          The maximum number of game sessions that an individual can create during the policy period.

        • PolicyPeriodInMinutes (integer) --

          The 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) --

        A unique identifier for an AWS IAM role that manages access to your AWS services. With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes). Create a role or look up a role's ARN from 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.

      • CertificateConfiguration (dict) --

        Indicates whether a TLS/SSL certificate was generated for the fleet.

        • CertificateType (string) --

          Indicates whether a TLS/SSL certificate was generated for a fleet.

CreateGameSession (updated) Link ¶
Changes (response)
{'GameSession': {'FleetArn': 'string'}}

Creates a multiplayer game session for players. This action creates a game session record and assigns an available server process in the specified fleet to host the game session. A fleet must have an ACTIVE status before a game session can be created in it.

To create a game session, specify either fleet ID or alias ID and indicate a maximum number of players to allow in the game session. You can also provide a name and game-specific properties for this game session. If successful, a GameSession object is returned containing the game session properties and other settings you specified.

Idempotency tokens. You can add a token that uniquely identifies game session requests. This is useful for ensuring that game session requests are idempotent. Multiple requests with the same idempotency token are processed only once; subsequent requests return the original result. All response values are the same with the exception of game session status, which may change.

Resource creation limits. If you are creating a game session on a fleet with a resource creation limit policy in force, then you must specify a creator ID. Without this ID, Amazon GameLift has no way to evaluate the policy for this new game session request.

Player acceptance policy. By default, newly created game sessions are open to new players. You can restrict new player access by using UpdateGameSession to change the game session's player session creation policy.

Game session logs. Logs are retained for all active game sessions for 14 days. To access the logs, call GetGameSessionLogUrl to download the log files.

Available in Amazon GameLift Local.

  • CreateGameSession

  • DescribeGameSessions

  • DescribeGameSessionDetails

  • SearchGameSessions

  • UpdateGameSession

  • GetGameSessionLogUrl

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.create_game_session(
    FleetId='string',
    AliasId='string',
    MaximumPlayerSessionCount=123,
    Name='string',
    GameProperties=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    CreatorId='string',
    GameSessionId='string',
    IdempotencyToken='string',
    GameSessionData='string'
)
type FleetId:

string

param FleetId:

A unique identifier for a fleet to create a game session in. You can use either the fleet ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.

type AliasId:

string

param AliasId:

A unique identifier for an alias associated with the fleet to create a game session in. You can use either the alias ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.

type MaximumPlayerSessionCount:

integer

param MaximumPlayerSessionCount:

[REQUIRED]

The maximum number of players that can be connected simultaneously to the game session.

type Name:

string

param Name:

A descriptive label that is associated with a game session. Session names do not need to be unique.

type GameProperties:

list

param GameProperties:

Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session).

  • (dict) --

    Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session. For example, a game property might specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session. For more information, see the Amazon GameLift Developer Guide.

    • Key (string) -- [REQUIRED]

      The game property identifier.

    • Value (string) -- [REQUIRED]

      The game property value.

type CreatorId:

string

param CreatorId:

A unique identifier for a player or entity creating the game session. This ID is used to enforce a resource protection policy (if one exists) that limits the number of concurrent active game sessions one player can have.

type GameSessionId:

string

param GameSessionId:

This parameter is no longer preferred. Please use IdempotencyToken instead. Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. (A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token>.)

type IdempotencyToken:

string

param IdempotencyToken:

Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. (A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token>.) Idempotency tokens remain in use for 30 days after a game session has ended; game session objects are retained for this time period and then deleted.

type GameSessionData:

string

param GameSessionData:

Set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session).

rtype:

dict

returns:

Response Syntax

{
    'GameSession': {
        'GameSessionId': 'string',
        'Name': 'string',
        'FleetId': 'string',
        'FleetArn': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'TerminationTime': datetime(2015, 1, 1),
        'CurrentPlayerSessionCount': 123,
        'MaximumPlayerSessionCount': 123,
        'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR',
        'StatusReason': 'INTERRUPTED',
        'GameProperties': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'IpAddress': 'string',
        'DnsName': 'string',
        'Port': 123,
        'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL',
        'CreatorId': 'string',
        'GameSessionData': 'string',
        'MatchmakerData': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSession (dict) --

      Object that describes the newly created game session record.

      • GameSessionId (string) --

        A unique identifier for the game session. A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token>.

      • Name (string) --

        A descriptive label that is associated with a game session. Session names do not need to be unique.

      • FleetId (string) --

        A unique identifier for a fleet that the game session is running on.

      • FleetArn (string) --

        The Amazon Resource Name ( ARN) associated with the GameLift fleet that this game session is running on.

      • 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").

      • CurrentPlayerSessionCount (integer) --

        Number of players currently in the game session.

      • MaximumPlayerSessionCount (integer) --

        The maximum number of players that can be connected simultaneously to the game session.

      • Status (string) --

        Current status of the game session. A game session must have an ACTIVE status to have player sessions.

      • StatusReason (string) --

        Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.

      • GameProperties (list) --

        Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). You can search for active game sessions based on this custom data with SearchGameSessions.

        • (dict) --

          Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session. For example, a game property might specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session. For more information, see the Amazon GameLift Developer Guide.

          • Key (string) --

            The game property identifier.

          • Value (string) --

            The game property value.

      • IpAddress (string) --

        IP address of the instance that is running the game session. When connecting to a Amazon GameLift game server, a client needs to reference an IP address (or DNS name) and port number.

      • DnsName (string) --

        DNS identifier assigned to the instance that is running the game session. Values have the following format:

        • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.

        • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.)

        When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

      • Port (integer) --

        Port number for the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.

      • PlayerSessionCreationPolicy (string) --

        Indicates whether or not the game session is accepting new players.

      • CreatorId (string) --

        A unique identifier for a player. This ID is used to enforce a resource protection policy (if one exists), that limits the number of game sessions a player can create.

      • GameSessionData (string) --

        Set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session).

      • MatchmakerData (string) --

        Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formatted as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data. Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill).

CreateGameSessionQueue (updated) Link ¶
Changes (request)
{'Tags': [{'Key': 'string', 'Value': 'string'}]}

Establishes a new queue for processing requests to place new game sessions. A queue identifies where new game sessions can be hosted -- by specifying a list of destinations (fleets or aliases) -- and how long requests can wait in the queue before timing out. You can set up a queue to try to place game sessions on fleets in multiple Regions. To add placement requests to a queue, call StartGameSessionPlacement and reference the queue name.

Destination order. When processing a request for a game session, Amazon GameLift tries each destination in order until it finds one with available resources to host the new game session. A queue's default order is determined by how destinations are listed. The default order is overridden when a game session placement request provides player latency information. Player latency information enables Amazon GameLift to prioritize destinations where players report the lowest average latency, as a result placing the new game session where the majority of players will have the best possible gameplay experience.

Player latency policies. For placement requests containing player latency information, use player latency policies to protect individual players from very high latencies. With a latency cap, even when a destination can deliver a low latency for most players, the game is not placed where any individual player is reporting latency higher than a policy's maximum. A queue can have multiple latency policies, which are enforced consecutively starting with the policy with the lowest latency cap. Use multiple policies to gradually relax latency controls; for example, you might set a policy with a low latency cap for the first 60 seconds, a second policy with a higher cap for the next 60 seconds, etc.

To create a new queue, provide a name, timeout value, a list of destinations and, if desired, a set of latency policies. If successful, a new queue object is returned.

  • CreateGameSessionQueue

  • DescribeGameSessionQueues

  • UpdateGameSessionQueue

  • DeleteGameSessionQueue

See also: AWS API Documentation

Request Syntax

client.create_game_session_queue(
    Name='string',
    TimeoutInSeconds=123,
    PlayerLatencyPolicies=[
        {
            'MaximumIndividualPlayerLatencyMilliseconds': 123,
            'PolicyDurationSeconds': 123
        },
    ],
    Destinations=[
        {
            'DestinationArn': 'string'
        },
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Name:

string

param Name:

[REQUIRED]

A descriptive label that is associated with game session queue. Queue names must be unique within each Region.

type TimeoutInSeconds:

integer

param TimeoutInSeconds:

The maximum time, in seconds, that a new game session placement request remains in the queue. When a request exceeds this time, the game session placement changes to a TIMED_OUT status.

type PlayerLatencyPolicies:

list

param PlayerLatencyPolicies:

A collection of latency policies to apply when processing game sessions placement requests with player latency information. Multiple policies are evaluated in order of the maximum latency value, starting with the lowest latency values. With just one policy, the policy is enforced at the start of the game session placement for the duration period. With multiple policies, each policy is enforced consecutively for its duration period. For example, a queue might enforce a 60-second policy followed by a 120-second policy, and then no policy for the remainder of the placement. A player latency policy must set a value for MaximumIndividualPlayerLatencyMilliseconds. If none is set, this API request fails.

  • (dict) --

    Queue setting that determines the highest latency allowed for individual players when placing a game session. When a latency policy is in force, a game session cannot be placed with any fleet in a Region where a player reports latency higher than the cap. Latency policies are only enforced when the placement request contains player latency information.

    • CreateGameSessionQueue

    • DescribeGameSessionQueues

    • UpdateGameSessionQueue

    • DeleteGameSessionQueue

    • MaximumIndividualPlayerLatencyMilliseconds (integer) --

      The maximum latency value that is allowed for any player, in milliseconds. All policies must have a value set for this property.

    • PolicyDurationSeconds (integer) --

      The length of time, in seconds, that the policy is enforced while placing a new game session. A null value for this property means that the policy is enforced until the queue times out.

type Destinations:

list

param Destinations:

A list of fleets that can be used to fulfill game session placement requests in the queue. Fleets are identified by either a fleet ARN or a fleet alias ARN. Destinations are listed in default preference order.

  • (dict) --

    Fleet designated in a game session queue. Requests for new game sessions in the queue are fulfilled by starting a new game session on any destination that is configured for a queue.

    • CreateGameSessionQueue

    • DescribeGameSessionQueues

    • UpdateGameSessionQueue

    • DeleteGameSessionQueue

    • DestinationArn (string) --

      The Amazon Resource Name (ARN) that is assigned to fleet or fleet alias. ARNs, which include a fleet ID or alias ID and a Region name, provide a unique identifier across all Regions.

type Tags:

list

param Tags:

A list of labels to assign to the new game session queue resource. Tags are developer-defined key-value pairs. Tagging AWS resources are useful for resource management, access management and cost allocation. For more information, see Tagging AWS Resources in the AWS General Reference. Once the resource is created, you can use TagResource, UntagResource, and ListTagsForResource to add, remove, and view tags. The maximum tag limit may be lower than stated. See the AWS General Reference for actual tagging limits.

  • (dict) --

    A label that can be assigned to a GameLift resource.

    Learn more

    Tagging AWS Resources in the AWS General Reference

    AWS Tagging Strategies

    Related operations

    • TagResource

    • UntagResource

    • ListTagsForResource

    • Key (string) -- [REQUIRED]

      The key for a developer-defined key:value pair for tagging an AWS resource.

    • Value (string) -- [REQUIRED]

      The value for a developer-defined key:value pair for tagging an AWS resource.

rtype:

dict

returns:

Response Syntax

{
    'GameSessionQueue': {
        'Name': 'string',
        'GameSessionQueueArn': 'string',
        'TimeoutInSeconds': 123,
        'PlayerLatencyPolicies': [
            {
                'MaximumIndividualPlayerLatencyMilliseconds': 123,
                'PolicyDurationSeconds': 123
            },
        ],
        'Destinations': [
            {
                'DestinationArn': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSessionQueue (dict) --

      An object that describes the newly created game session queue.

      • Name (string) --

        A descriptive label that is associated with game session queue. Queue names must be unique within each Region.

      • GameSessionQueueArn (string) --

        Amazon Resource Name ( ARN) that is assigned to a GameLift game session queue resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift game session queue ARN, the resource ID matches the Name value.

      • TimeoutInSeconds (integer) --

        The maximum time, in seconds, that a new game session placement request remains in the queue. When a request exceeds this time, the game session placement changes to a TIMED_OUT status.

      • PlayerLatencyPolicies (list) --

        A collection of latency policies to apply when processing game sessions placement requests with player latency information. Multiple policies are evaluated in order of the maximum latency value, starting with the lowest latency values. With just one policy, the policy is enforced at the start of the game session placement for the duration period. With multiple policies, each policy is enforced consecutively for its duration period. For example, a queue might enforce a 60-second policy followed by a 120-second policy, and then no policy for the remainder of the placement.

        • (dict) --

          Queue setting that determines the highest latency allowed for individual players when placing a game session. When a latency policy is in force, a game session cannot be placed with any fleet in a Region where a player reports latency higher than the cap. Latency policies are only enforced when the placement request contains player latency information.

          • CreateGameSessionQueue

          • DescribeGameSessionQueues

          • UpdateGameSessionQueue

          • DeleteGameSessionQueue

          • MaximumIndividualPlayerLatencyMilliseconds (integer) --

            The maximum latency value that is allowed for any player, in milliseconds. All policies must have a value set for this property.

          • PolicyDurationSeconds (integer) --

            The length of time, in seconds, that the policy is enforced while placing a new game session. A null value for this property means that the policy is enforced until the queue times out.

      • Destinations (list) --

        A list of fleets that can be used to fulfill game session placement requests in the queue. Fleets are identified by either a fleet ARN or a fleet alias ARN. Destinations are listed in default preference order.

        • (dict) --

          Fleet designated in a game session queue. Requests for new game sessions in the queue are fulfilled by starting a new game session on any destination that is configured for a queue.

          • CreateGameSessionQueue

          • DescribeGameSessionQueues

          • UpdateGameSessionQueue

          • DeleteGameSessionQueue

          • DestinationArn (string) --

            The Amazon Resource Name (ARN) that is assigned to fleet or fleet alias. ARNs, which include a fleet ID or alias ID and a Region name, provide a unique identifier across all Regions.

CreateMatchmakingConfiguration (updated) Link ¶
Changes (request, response)
Request
{'Tags': [{'Key': 'string', 'Value': 'string'}]}
Response
{'Configuration': {'ConfigurationArn': 'string', 'RuleSetArn': 'string'}}

Defines a new matchmaking configuration for use with FlexMatch. A matchmaking configuration sets out guidelines for matching players and getting the matches into games. You can set up multiple matchmaking configurations to handle the scenarios needed for your game. Each matchmaking ticket ( StartMatchmaking or StartMatchBackfill) specifies a configuration for the match and provides player attributes to support the configuration being used.

To create a matchmaking configuration, at a minimum you must specify the following: configuration name; a rule set that governs how to evaluate players and find acceptable matches; a game session queue to use when placing a new game session for the match; and the maximum time allowed for a matchmaking attempt.

There are two ways to track the progress of matchmaking tickets: (1) polling ticket status with DescribeMatchmaking; or (2) receiving notifications with Amazon Simple Notification Service (SNS). To use notifications, you first need to set up an SNS topic to receive the notifications, and provide the topic ARN in the matchmaking configuration. Since notifications promise only "best effort" delivery, we recommend calling DescribeMatchmaking if no notifications are received within 30 seconds.

Learn more

Design a FlexMatch Matchmaker

Setting up Notifications for Matchmaking

Related operations

  • CreateMatchmakingConfiguration

  • DescribeMatchmakingConfigurations

  • UpdateMatchmakingConfiguration

  • DeleteMatchmakingConfiguration

  • CreateMatchmakingRuleSet

  • DescribeMatchmakingRuleSets

  • ValidateMatchmakingRuleSet

  • DeleteMatchmakingRuleSet

See also: AWS API Documentation

Request Syntax

client.create_matchmaking_configuration(
    Name='string',
    Description='string',
    GameSessionQueueArns=[
        'string',
    ],
    RequestTimeoutSeconds=123,
    AcceptanceTimeoutSeconds=123,
    AcceptanceRequired=True|False,
    RuleSetName='string',
    NotificationTarget='string',
    AdditionalPlayerCount=123,
    CustomEventData='string',
    GameProperties=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    GameSessionData='string',
    BackfillMode='AUTOMATIC'|'MANUAL',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Name:

string

param Name:

[REQUIRED]

A unique identifier for a matchmaking configuration. This name is used to identify the configuration associated with a matchmaking request or ticket.

type Description:

string

param Description:

A human-readable description of the matchmaking configuration.

type GameSessionQueueArns:

list

param GameSessionQueueArns:

[REQUIRED]

Amazon Resource Name ( ARN) that is assigned to a GameLift game session queue resource and uniquely identifies it. ARNs are unique across all Regions. These queues are used when placing game sessions for matches that are created with this matchmaking configuration. Queues can be located in any Region.

  • (string) --

type RequestTimeoutSeconds:

integer

param RequestTimeoutSeconds:

[REQUIRED]

The maximum duration, in seconds, that a matchmaking ticket can remain in process before timing out. Requests that fail due to timing out can be resubmitted as needed.

type AcceptanceTimeoutSeconds:

integer

param AcceptanceTimeoutSeconds:

The length of time (in seconds) to wait for players to accept a proposed match. If any player rejects the match or fails to accept before the timeout, the ticket continues to look for an acceptable match.

type AcceptanceRequired:

boolean

param AcceptanceRequired:

[REQUIRED]

A flag that determines whether a match that was created with this configuration must be accepted by the matched players. To require acceptance, set to TRUE.

type RuleSetName:

string

param RuleSetName:

[REQUIRED]

A unique identifier for a matchmaking rule set to use with this configuration. You can use either the rule set name or ARN value. A matchmaking configuration can only use rule sets that are defined in the same Region.

type NotificationTarget:

string

param NotificationTarget:

An SNS topic ARN that is set up to receive matchmaking notifications.

type AdditionalPlayerCount:

integer

param AdditionalPlayerCount:

The number of player slots in a match to keep open for future players. For example, assume that the configuration's rule set specifies a match for a single 12-person team. If the additional player count is set to 2, only 10 players are initially selected for the match.

type CustomEventData:

string

param CustomEventData:

Information to be added to all events related to this matchmaking configuration.

type GameProperties:

list

param GameProperties:

A set of custom properties for a game session, formatted as key-value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). This information is added to the new GameSession object that is created for a successful match.

  • (dict) --

    Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session. For example, a game property might specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session. For more information, see the Amazon GameLift Developer Guide.

    • Key (string) -- [REQUIRED]

      The game property identifier.

    • Value (string) -- [REQUIRED]

      The game property value.

type GameSessionData:

string

param GameSessionData:

A set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). This information is added to the new GameSession object that is created for a successful match.

type BackfillMode:

string

param BackfillMode:

The method used to backfill game sessions that are created with this matchmaking configuration. Specify MANUAL when your game manages backfill requests manually or does not use the match backfill feature. Specify AUTOMATIC to have GameLift create a StartMatchBackfill request whenever a game session has one or more open slots. Learn more about manual and automatic backfill in Backfill Existing Games with FlexMatch.

type Tags:

list

param Tags:

A list of labels to assign to the new matchmaking configuration resource. Tags are developer-defined key-value pairs. Tagging AWS resources are useful for resource management, access management and cost allocation. For more information, see Tagging AWS Resources in the AWS General Reference. Once the resource is created, you can use TagResource, UntagResource, and ListTagsForResource to add, remove, and view tags. The maximum tag limit may be lower than stated. See the AWS General Reference for actual tagging limits.

  • (dict) --

    A label that can be assigned to a GameLift resource.

    Learn more

    Tagging AWS Resources in the AWS General Reference

    AWS Tagging Strategies

    Related operations

    • TagResource

    • UntagResource

    • ListTagsForResource

    • Key (string) -- [REQUIRED]

      The key for a developer-defined key:value pair for tagging an AWS resource.

    • Value (string) -- [REQUIRED]

      The value for a developer-defined key:value pair for tagging an AWS resource.

rtype:

dict

returns:

Response Syntax

{
    'Configuration': {
        'Name': 'string',
        'ConfigurationArn': 'string',
        'Description': 'string',
        'GameSessionQueueArns': [
            'string',
        ],
        'RequestTimeoutSeconds': 123,
        'AcceptanceTimeoutSeconds': 123,
        'AcceptanceRequired': True|False,
        'RuleSetName': 'string',
        'RuleSetArn': 'string',
        'NotificationTarget': 'string',
        'AdditionalPlayerCount': 123,
        'CustomEventData': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'GameProperties': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'GameSessionData': 'string',
        'BackfillMode': 'AUTOMATIC'|'MANUAL'
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • Configuration (dict) --

      Object that describes the newly created matchmaking configuration.

      • Name (string) --

        A unique identifier for a matchmaking configuration. This name is used to identify the configuration associated with a matchmaking request or ticket.

      • ConfigurationArn (string) --

        Amazon Resource Name ( ARN) that is assigned to a GameLift matchmaking configuration resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift configuration ARN, the resource ID matches the Name value.

      • Description (string) --

        A descriptive label that is associated with matchmaking configuration.

      • GameSessionQueueArns (list) --

        Amazon Resource Name ( ARN) that is assigned to a GameLift game session queue resource and uniquely identifies it. ARNs are unique across all Regions. GameLift uses the listed queues when placing game sessions for matches that are created with this matchmaking configuration. Queues can be located in any Region.

        • (string) --

      • RequestTimeoutSeconds (integer) --

        The maximum duration, in seconds, that a matchmaking ticket can remain in process before timing out. Requests that fail due to timing out can be resubmitted as needed.

      • AcceptanceTimeoutSeconds (integer) --

        The length of time (in seconds) to wait for players to accept a proposed match. If any player rejects the match or fails to accept before the timeout, the ticket continues to look for an acceptable match.

      • AcceptanceRequired (boolean) --

        A flag that indicates whether a match that was created with this configuration must be accepted by the matched players. To require acceptance, set to TRUE.

      • RuleSetName (string) --

        A unique identifier for a matchmaking rule set to use with this configuration. A matchmaking configuration can only use rule sets that are defined in the same Region.

      • RuleSetArn (string) --

        The Amazon Resource Name ( ARN) associated with the GameLift matchmaking rule set resource that this configuration uses.

      • NotificationTarget (string) --

        An SNS topic ARN that is set up to receive matchmaking notifications.

      • AdditionalPlayerCount (integer) --

        The number of player slots in a match to keep open for future players. For example, assume that the configuration's rule set specifies a match for a single 12-person team. If the additional player count is set to 2, only 10 players are initially selected for the match.

      • CustomEventData (string) --

        Information to attach to all events related to the matchmaking configuration.

      • CreationTime (datetime) --

        The time stamp indicating when this data object was created. The format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • GameProperties (list) --

        A set of custom properties for a game session, formatted as key-value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). This information is added to the new GameSession object that is created for a successful match.

        • (dict) --

          Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session. For example, a game property might specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session. For more information, see the Amazon GameLift Developer Guide.

          • Key (string) --

            The game property identifier.

          • Value (string) --

            The game property value.

      • GameSessionData (string) --

        A set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). This information is added to the new GameSession object that is created for a successful match.

      • BackfillMode (string) --

        The method used to backfill game sessions created with this matchmaking configuration. MANUAL indicates that the game makes backfill requests or does not use the match backfill feature. AUTOMATIC indicates that GameLift creates StartMatchBackfill requests whenever a game session has one or more open slots. Learn more about manual and automatic backfill in Backfill Existing Games with FlexMatch.

CreateMatchmakingRuleSet (updated) Link ¶
Changes (request, response)
Request
{'Tags': [{'Key': 'string', 'Value': 'string'}]}
Response
{'RuleSet': {'RuleSetArn': 'string'}}

Creates a new rule set for FlexMatch matchmaking. A rule set describes the type of match to create, such as the number and size of teams. It also sets the parameters for acceptable player matches, such as minimum skill level or character type. A rule set is used by a MatchmakingConfiguration.

To create a matchmaking rule set, provide unique rule set name and the rule set body in JSON format. Rule sets must be defined in the same Region as the matchmaking configuration they are used with.

Since matchmaking rule sets cannot be edited, it is a good idea to check the rule set syntax using ValidateMatchmakingRuleSet before creating a new rule set.

Learn more

Related operations

  • CreateMatchmakingConfiguration

  • DescribeMatchmakingConfigurations

  • UpdateMatchmakingConfiguration

  • DeleteMatchmakingConfiguration

  • CreateMatchmakingRuleSet

  • DescribeMatchmakingRuleSets

  • ValidateMatchmakingRuleSet

  • DeleteMatchmakingRuleSet

See also: AWS API Documentation

Request Syntax

client.create_matchmaking_rule_set(
    Name='string',
    RuleSetBody='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Name:

string

param Name:

[REQUIRED]

A unique identifier for a matchmaking rule set. A matchmaking configuration identifies the rule set it uses by this name value. Note that the rule set name is different from the optional name field in the rule set body.

type RuleSetBody:

string

param RuleSetBody:

[REQUIRED]

A collection of matchmaking rules, formatted as a JSON string. Comments are not allowed in JSON, but most elements support a description field.

type Tags:

list

param Tags:

A list of labels to assign to the new matchmaking rule set resource. Tags are developer-defined key-value pairs. Tagging AWS resources are useful for resource management, access management and cost allocation. For more information, see Tagging AWS Resources in the AWS General Reference. Once the resource is created, you can use TagResource, UntagResource, and ListTagsForResource to add, remove, and view tags. The maximum tag limit may be lower than stated. See the AWS General Reference for actual tagging limits.

  • (dict) --

    A label that can be assigned to a GameLift resource.

    Learn more

    Tagging AWS Resources in the AWS General Reference

    AWS Tagging Strategies

    Related operations

    • TagResource

    • UntagResource

    • ListTagsForResource

    • Key (string) -- [REQUIRED]

      The key for a developer-defined key:value pair for tagging an AWS resource.

    • Value (string) -- [REQUIRED]

      The value for a developer-defined key:value pair for tagging an AWS resource.

rtype:

dict

returns:

Response Syntax

{
    'RuleSet': {
        'RuleSetName': 'string',
        'RuleSetArn': 'string',
        'RuleSetBody': 'string',
        'CreationTime': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • RuleSet (dict) --

      The newly created matchmaking rule set.

      • RuleSetName (string) --

        A unique identifier for a matchmaking rule set

      • RuleSetArn (string) --

        Amazon Resource Name ( ARN) that is assigned to a GameLift matchmaking rule set resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift rule set ARN, the resource ID matches the RuleSetName value.

      • RuleSetBody (string) --

        A collection of matchmaking rules, formatted as a JSON string. Comments are not allowed in JSON, but most elements support a description field.

      • CreationTime (datetime) --

        The time stamp indicating when this data object was created. The format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

CreatePlayerSession (updated) Link ¶
Changes (response)
{'PlayerSession': {'FleetArn': 'string'}}

Reserves an open player slot in an active game session. Before a player can be added, a game session must have an ACTIVE status, have a creation policy of ALLOW_ALL, and have an open player slot. To add a group of players to a game session, use CreatePlayerSessions. When the player connects to the game server and references a player session ID, the game server contacts the Amazon GameLift service to validate the player reservation and accept the player.

To create a player session, specify a game session ID, player ID, and optionally a string of player data. If successful, a slot is reserved in the game session for the player and a new PlayerSession object is returned. Player sessions cannot be updated.

Available in Amazon GameLift Local.

  • CreatePlayerSession

  • CreatePlayerSessions

  • DescribePlayerSessions

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.create_player_session(
    GameSessionId='string',
    PlayerId='string',
    PlayerData='string'
)
type GameSessionId:

string

param GameSessionId:

[REQUIRED]

A unique identifier for the game session to add a player to.

type PlayerId:

string

param PlayerId:

[REQUIRED]

A unique identifier for a player. Player IDs are developer-defined.

type PlayerData:

string

param PlayerData:

Developer-defined information related to a player. Amazon GameLift does not use this data, so it can be formatted as needed for use in the game.

rtype:

dict

returns:

Response Syntax

{
    'PlayerSession': {
        'PlayerSessionId': 'string',
        'PlayerId': 'string',
        'GameSessionId': 'string',
        'FleetId': 'string',
        'FleetArn': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'TerminationTime': datetime(2015, 1, 1),
        'Status': 'RESERVED'|'ACTIVE'|'COMPLETED'|'TIMEDOUT',
        'IpAddress': 'string',
        'DnsName': 'string',
        'Port': 123,
        'PlayerData': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • PlayerSession (dict) --

      Object that describes the newly created player session record.

      • PlayerSessionId (string) --

        A unique identifier for a player session.

      • PlayerId (string) --

        A unique identifier for a player that is associated with this player session.

      • GameSessionId (string) --

        A unique identifier for the game session that the player session is connected to.

      • FleetId (string) --

        A unique identifier for a fleet that the player's game session is running on.

      • FleetArn (string) --

        The Amazon Resource Name ( ARN) associated with the GameLift fleet that the player's game session is running on.

      • 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 player session.

        Possible player session statuses include the following:

        • RESERVED -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.

        • ACTIVE -- The player has been validated by the server process and is currently connected.

        • COMPLETED -- The player connection has been dropped.

        • TIMEDOUT -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).

      • IpAddress (string) --

        IP address of the instance that is running the game session. When connecting to a Amazon GameLift game server, a client needs to reference an IP address (or DNS name) and port number.

      • DnsName (string) --

        DNS identifier assigned to the instance that is running the game session. Values have the following format:

        • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.

        • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.)

        When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

      • Port (integer) --

        Port number for the game session. To connect to a Amazon GameLift server process, an app needs both the IP address and port number.

      • PlayerData (string) --

        Developer-defined information related to a player. Amazon GameLift does not use this data, so it can be formatted as needed for use in the game.

CreatePlayerSessions (updated) Link ¶
Changes (response)
{'PlayerSessions': {'FleetArn': 'string'}}

Reserves open slots in a game session for a group of players. Before players can be added, a game session must have an ACTIVE status, have a creation policy of ALLOW_ALL, and have an open player slot. To add a single player to a game session, use CreatePlayerSession. When a player connects to the game server and references a player session ID, the game server contacts the Amazon GameLift service to validate the player reservation and accept the player.

To create player sessions, specify a game session ID, a list of player IDs, and optionally a set of player data strings. If successful, a slot is reserved in the game session for each player and a set of new PlayerSession objects is returned. Player sessions cannot be updated.

Available in Amazon GameLift Local.

  • CreatePlayerSession

  • CreatePlayerSessions

  • DescribePlayerSessions

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.create_player_sessions(
    GameSessionId='string',
    PlayerIds=[
        'string',
    ],
    PlayerDataMap={
        'string': 'string'
    }
)
type GameSessionId:

string

param GameSessionId:

[REQUIRED]

A unique identifier for the game session to add players to.

type PlayerIds:

list

param PlayerIds:

[REQUIRED]

List of unique identifiers for the players to be added.

  • (string) --

type PlayerDataMap:

dict

param PlayerDataMap:

Map of string pairs, each specifying a player ID and a set of developer-defined information related to the player. Amazon GameLift does not use this data, so it can be formatted as needed for use in the game. Player data strings for player IDs not included in the PlayerIds parameter are ignored.

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'PlayerSessions': [
        {
            'PlayerSessionId': 'string',
            'PlayerId': 'string',
            'GameSessionId': 'string',
            'FleetId': 'string',
            'FleetArn': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'TerminationTime': datetime(2015, 1, 1),
            'Status': 'RESERVED'|'ACTIVE'|'COMPLETED'|'TIMEDOUT',
            'IpAddress': 'string',
            'DnsName': 'string',
            'Port': 123,
            'PlayerData': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • PlayerSessions (list) --

      A collection of player session objects created for the added players.

      • (dict) --

        Properties describing a player session. Player session objects are created either by creating a player session for a specific game session, or as part of a game session placement. A player session represents either a player reservation for a game session (status RESERVED) or actual player activity in a game session (status ACTIVE). A player session object (including player data) is automatically passed to a game session when the player connects to the game session and is validated.

        When a player disconnects, the player session status changes to COMPLETED. Once the session ends, the player session object is retained for 30 days and then removed.

        • CreatePlayerSession

        • CreatePlayerSessions

        • DescribePlayerSessions

        • Game session placements

          • StartGameSessionPlacement

          • DescribeGameSessionPlacement

          • StopGameSessionPlacement

        • PlayerSessionId (string) --

          A unique identifier for a player session.

        • PlayerId (string) --

          A unique identifier for a player that is associated with this player session.

        • GameSessionId (string) --

          A unique identifier for the game session that the player session is connected to.

        • FleetId (string) --

          A unique identifier for a fleet that the player's game session is running on.

        • FleetArn (string) --

          The Amazon Resource Name ( ARN) associated with the GameLift fleet that the player's game session is running on.

        • 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 player session.

          Possible player session statuses include the following:

          • RESERVED -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.

          • ACTIVE -- The player has been validated by the server process and is currently connected.

          • COMPLETED -- The player connection has been dropped.

          • TIMEDOUT -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).

        • IpAddress (string) --

          IP address of the instance that is running the game session. When connecting to a Amazon GameLift game server, a client needs to reference an IP address (or DNS name) and port number.

        • DnsName (string) --

          DNS identifier assigned to the instance that is running the game session. Values have the following format:

          • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.

          • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.)

          When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

        • Port (integer) --

          Port number for the game session. To connect to a Amazon GameLift server process, an app needs both the IP address and port number.

        • PlayerData (string) --

          Developer-defined information related to a player. Amazon GameLift does not use this data, so it can be formatted as needed for use in the game.

CreateScript (updated) Link ¶
Changes (request, response)
Request
{'Tags': [{'Key': 'string', 'Value': 'string'}]}
Response
{'Script': {'ScriptArn': 'string'}}

Creates a new script record for your Realtime Servers script. Realtime scripts are JavaScript that provide configuration settings and optional custom game logic for your game. The script is deployed when you create a Realtime Servers fleet to host your game sessions. Script logic is executed during an active game session.

To create a new script record, specify a script name and provide the script file(s). The script files and all dependencies must be zipped into a single file. You can pull the zip file from either of these locations:

  • A locally available directory. Use the ZipFile parameter for this option.

  • An Amazon Simple Storage Service (Amazon S3) bucket under your AWS account. Use the StorageLocation parameter for this option. You'll need to have an Identity Access Management (IAM) role that allows the Amazon GameLift service to access your S3 bucket.

If the call is successful, a new script record is created with a unique script ID. If the script file is provided as a local file, the file is uploaded to an Amazon GameLift-owned S3 bucket and the script record's storage location reflects this location. If the script file is provided as an S3 bucket, Amazon GameLift accesses the file at this storage location as needed for deployment.

Learn more

Amazon GameLift Realtime Servers

Set Up a Role for Amazon GameLift Access

Related operations

  • CreateScript

  • ListScripts

  • DescribeScript

  • UpdateScript

  • DeleteScript

See also: AWS API Documentation

Request Syntax

client.create_script(
    Name='string',
    Version='string',
    StorageLocation={
        'Bucket': 'string',
        'Key': 'string',
        'RoleArn': 'string',
        'ObjectVersion': 'string'
    },
    ZipFile=b'bytes',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Name:

string

param Name:

A descriptive label that is associated with a script. Script names do not need to be unique. You can use UpdateScript to change this value later.

type Version:

string

param Version:

The version that is associated with a build or script. Version strings do not need to be unique. You can use UpdateScript to change this value later.

type StorageLocation:

dict

param StorageLocation:

The location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon GameLift to access the Amazon S3 storage location. The S3 bucket must be in the same Region where you want to create a new script. By default, Amazon GameLift uploads the latest version of the zip file; if you have S3 object versioning turned on, you can use the ObjectVersion parameter to specify an earlier version.

  • Bucket (string) --

    An Amazon S3 bucket identifier. This is the name of the S3 bucket.

  • Key (string) --

    The name of the zip file that contains the build files or script files.

  • RoleArn (string) --

    The Amazon Resource Name ( ARN) for an IAM role that allows Amazon GameLift to access the S3 bucket.

  • ObjectVersion (string) --

    The version of the file, if object versioning is turned on for the bucket. Amazon GameLift uses this information when retrieving files from an S3 bucket that you own. Use this parameter to specify a specific version of the file. If not set, the latest version of the file is retrieved.

type ZipFile:

bytes

param ZipFile:

A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.

When using the AWS CLI tool to create a script, this parameter is set to the zip file name. It must be prepended with the string "fileb://" to indicate that the file data is a binary object. For example: --zip-file fileb://myRealtimeScript.zip.

type Tags:

list

param Tags:

A list of labels to assign to the new script resource. Tags are developer-defined key-value pairs. Tagging AWS resources are useful for resource management, access management and cost allocation. For more information, see Tagging AWS Resources in the AWS General Reference. Once the resource is created, you can use TagResource, UntagResource, and ListTagsForResource to add, remove, and view tags. The maximum tag limit may be lower than stated. See the AWS General Reference for actual tagging limits.

  • (dict) --

    A label that can be assigned to a GameLift resource.

    Learn more

    Tagging AWS Resources in the AWS General Reference

    AWS Tagging Strategies

    Related operations

    • TagResource

    • UntagResource

    • ListTagsForResource

    • Key (string) -- [REQUIRED]

      The key for a developer-defined key:value pair for tagging an AWS resource.

    • Value (string) -- [REQUIRED]

      The value for a developer-defined key:value pair for tagging an AWS resource.

rtype:

dict

returns:

Response Syntax

{
    'Script': {
        'ScriptId': 'string',
        'ScriptArn': 'string',
        'Name': 'string',
        'Version': 'string',
        'SizeOnDisk': 123,
        'CreationTime': datetime(2015, 1, 1),
        'StorageLocation': {
            'Bucket': 'string',
            'Key': 'string',
            'RoleArn': 'string',
            'ObjectVersion': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • Script (dict) --

      The newly created script record with a unique script ID and ARN. The new script's storage location reflects an Amazon S3 location: (1) If the script was uploaded from an S3 bucket under your account, the storage location reflects the information that was provided in the CreateScript request; (2) If the script file was uploaded from a local zip file, the storage location reflects an S3 location controls by the Amazon GameLift service.

      • ScriptId (string) --

        A unique identifier for a Realtime script

      • ScriptArn (string) --

        Amazon Resource Name ( ARN) that is assigned to a GameLift script resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift script ARN, the resource ID matches the ScriptId value.

      • Name (string) --

        A descriptive label that is associated with a script. Script names do not need to be unique.

      • Version (string) --

        The version that is associated with a build or script. Version strings do not need to be unique.

      • SizeOnDisk (integer) --

        The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 location, this value remains at "0".

      • CreationTime (datetime) --

        A time stamp indicating when this data object was created. The format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • StorageLocation (dict) --

        The location in Amazon S3 where build or script files are stored for access by Amazon GameLift. This location is specified in CreateBuild, CreateScript, and UpdateScript requests.

        • Bucket (string) --

          An Amazon S3 bucket identifier. This is the name of the S3 bucket.

        • Key (string) --

          The name of the zip file that contains the build files or script files.

        • RoleArn (string) --

          The Amazon Resource Name ( ARN) for an IAM role that allows Amazon GameLift to access the S3 bucket.

        • ObjectVersion (string) --

          The version of the file, if object versioning is turned on for the bucket. Amazon GameLift uses this information when retrieving files from an S3 bucket that you own. Use this parameter to specify a specific version of the file. If not set, the latest version of the file is retrieved.

DescribeBuild (updated) Link ¶
Changes (response)
{'Build': {'BuildArn': 'string'}}

Retrieves properties for a build. To request a build record, specify a build ID. If successful, an object containing the build properties is returned.

Learn more

Working with Builds

Related operations

  • CreateBuild

  • ListBuilds

  • DescribeBuild

  • UpdateBuild

  • DeleteBuild

See also: AWS API Documentation

Request Syntax

client.describe_build(
    BuildId='string'
)
type BuildId:

string

param BuildId:

[REQUIRED]

A unique identifier for a build to retrieve properties for. You can use either the build ID or ARN value.

rtype:

dict

returns:

Response Syntax

{
    'Build': {
        'BuildId': 'string',
        'BuildArn': 'string',
        'Name': 'string',
        'Version': 'string',
        'Status': 'INITIALIZED'|'READY'|'FAILED',
        'SizeOnDisk': 123,
        'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX'|'AMAZON_LINUX_2',
        'CreationTime': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • Build (dict) --

      Set of properties describing the requested build.

      • BuildId (string) --

        A unique identifier for a build.

      • BuildArn (string) --

        Amazon Resource Name ( ARN) that is assigned to a GameLift build resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift build ARN, the resource ID matches the BuildId value.

      • Name (string) --

        A descriptive label that is associated with a build. Build names do not need to be unique. It can be set using CreateBuild or UpdateBuild.

      • Version (string) --

        Version information that is associated with a build or script. Version strings do not need to be unique. This value can be set using CreateBuild or UpdateBuild.

      • Status (string) --

        Current status of the build.

        Possible build statuses include the following:

        • INITIALIZED -- A new build has been defined, but no files have been uploaded. You cannot create fleets for builds that are in this status. When a build is successfully created, the build status is set to this value.

        • READY -- The game build has been successfully uploaded. You can now create new fleets for this build.

        • FAILED -- The game build upload failed. You cannot create new fleets for this build.

      • SizeOnDisk (integer) --

        File size of the uploaded game build, expressed in bytes. When the build status is INITIALIZED, this value is 0.

      • OperatingSystem (string) --

        Operating system that the game server binaries are built to run on. This value determines the type of fleet resources that you can use for this build.

      • 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").

DescribeFleetAttributes (updated) Link ¶
Changes (response)
{'FleetAttributes': {'BuildArn': 'string', 'ScriptArn': '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

Working with Fleets.

Related operations

  • CreateFleet

  • ListFleets

  • DeleteFleet

  • Describe fleets:

    • DescribeFleetAttributes

    • DescribeFleetCapacity

    • DescribeFleetPortSettings

    • DescribeFleetUtilization

    • DescribeRuntimeConfiguration

    • DescribeEC2InstanceLimits

    • DescribeFleetEvents

  • UpdateFleetAttributes

  • Manage fleet actions:

    • StartFleetActions

    • StopFleetActions

See also: AWS API Documentation

Request Syntax

client.describe_fleet_attributes(
    FleetIds=[
        'string',
    ],
    Limit=123,
    NextToken='string'
)
type FleetIds:

list

param FleetIds:

A unique identifier for a fleet(s) to retrieve attributes for. You can use either the fleet ID or ARN value.

  • (string) --

type Limit:

integer

param Limit:

The 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.

type NextToken:

string

param NextToken:

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.

rtype:

dict

returns:

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'|'c5.large'|'c5.xlarge'|'c5.2xlarge'|'c5.4xlarge'|'c5.9xlarge'|'c5.12xlarge'|'c5.18xlarge'|'c5.24xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'r5.large'|'r5.xlarge'|'r5.2xlarge'|'r5.4xlarge'|'r5.8xlarge'|'r5.12xlarge'|'r5.16xlarge'|'r5.24xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge'|'m5.large'|'m5.xlarge'|'m5.2xlarge'|'m5.4xlarge'|'m5.8xlarge'|'m5.12xlarge'|'m5.16xlarge'|'m5.24xlarge',
            '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',
            'BuildArn': 'string',
            'ScriptId': 'string',
            'ScriptArn': 'string',
            'ServerLaunchPath': 'string',
            'ServerLaunchParameters': 'string',
            'LogPaths': [
                'string',
            ],
            'NewGameSessionProtectionPolicy': 'NoProtection'|'FullProtection',
            'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX'|'AMAZON_LINUX_2',
            'ResourceCreationLimitPolicy': {
                'NewGameSessionsPerCreator': 123,
                'PolicyPeriodInMinutes': 123
            },
            'MetricGroups': [
                'string',
            ],
            'StoppedActions': [
                'AUTO_SCALING',
            ],
            'InstanceRoleArn': 'string',
            'CertificateConfiguration': {
                'CertificateType': 'DISABLED'|'GENERATED'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • FleetAttributes (list) --

      A collection of objects containing attribute metadata for each requested fleet ID.

      • (dict) --

        General properties describing a fleet.

        • CreateFleet

        • ListFleets

        • DeleteFleet

        • DescribeFleetAttributes

        • UpdateFleetAttributes

        • Manage fleet actions:

          • StartFleetActions

          • StopFleetActions

        • FleetId (string) --

          A unique identifier for a fleet.

        • FleetArn (string) --

          The Amazon Resource Name ( ARN) that is assigned to a GameLift fleet resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift fleet ARN, the resource ID matches the FleetId value.

        • 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) --

          A 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 or Realtime script 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) --

          A unique identifier for a build.

        • BuildArn (string) --

          The Amazon Resource Name ( ARN) associated with the GameLift build resource that is deployed on instances in this fleet. In a GameLift build ARN, the resource ID matches the BuildId value.

        • ScriptId (string) --

          A unique identifier for a Realtime script.

        • ScriptArn (string) --

          The Amazon Resource Name ( ARN) associated with the GameLift script resource that is deployed on instances in this fleet. In a GameLift script ARN, the resource ID matches the ScriptId value.

        • 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) --

          The 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) --

            The maximum number of game sessions that an individual can create during the policy period.

          • PolicyPeriodInMinutes (integer) --

            The 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) --

          A unique identifier for an AWS IAM role that manages access to your AWS services. With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes). Create a role or look up a role's ARN from 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.

        • CertificateConfiguration (dict) --

          Indicates whether a TLS/SSL certificate was generated for the fleet.

          • CertificateType (string) --

            Indicates whether a TLS/SSL certificate was generated for a fleet.

    • 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.

DescribeGameSessionDetails (updated) Link ¶
Changes (response)
{'GameSessionDetails': {'GameSession': {'FleetArn': 'string'}}}

Retrieves properties, including the protection policy in force, for one or more game sessions. This action can be used in several ways: (1) provide a GameSessionId or GameSessionArn to request details for a specific game session; (2) provide either a FleetId or an AliasId to request properties for all game sessions running on a fleet.

To get game session record(s), specify just one of the following: game session ID, fleet ID, or alias ID. You can filter this request by game session status. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a GameSessionDetail object is returned for each session matching the request.

  • CreateGameSession

  • DescribeGameSessions

  • DescribeGameSessionDetails

  • SearchGameSessions

  • UpdateGameSession

  • GetGameSessionLogUrl

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.describe_game_session_details(
    FleetId='string',
    GameSessionId='string',
    AliasId='string',
    StatusFilter='string',
    Limit=123,
    NextToken='string'
)
type FleetId:

string

param FleetId:

A unique identifier for a fleet to retrieve all game sessions active on the fleet. You can use either the fleet ID or ARN value.

type GameSessionId:

string

param GameSessionId:

A unique identifier for the game session to retrieve.

type AliasId:

string

param AliasId:

A unique identifier for an alias associated with the fleet to retrieve all game sessions for. You can use either the alias ID or ARN value.

type StatusFilter:

string

param StatusFilter:

Game session status to filter results on. Possible game session statuses include ACTIVE, TERMINATED, ACTIVATING and TERMINATING (the last two are transitory).

type Limit:

integer

param Limit:

The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.

type NextToken:

string

param NextToken:

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.

rtype:

dict

returns:

Response Syntax

{
    'GameSessionDetails': [
        {
            'GameSession': {
                'GameSessionId': 'string',
                'Name': 'string',
                'FleetId': 'string',
                'FleetArn': 'string',
                'CreationTime': datetime(2015, 1, 1),
                'TerminationTime': datetime(2015, 1, 1),
                'CurrentPlayerSessionCount': 123,
                'MaximumPlayerSessionCount': 123,
                'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR',
                'StatusReason': 'INTERRUPTED',
                'GameProperties': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ],
                'IpAddress': 'string',
                'DnsName': 'string',
                'Port': 123,
                'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL',
                'CreatorId': 'string',
                'GameSessionData': 'string',
                'MatchmakerData': 'string'
            },
            'ProtectionPolicy': 'NoProtection'|'FullProtection'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSessionDetails (list) --

      A collection of objects containing game session properties and the protection policy currently in force for each session matching the request.

      • (dict) --

        A game session's properties plus the protection policy currently in force.

        • GameSession (dict) --

          Object that describes a game session.

          • GameSessionId (string) --

            A unique identifier for the game session. A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token>.

          • Name (string) --

            A descriptive label that is associated with a game session. Session names do not need to be unique.

          • FleetId (string) --

            A unique identifier for a fleet that the game session is running on.

          • FleetArn (string) --

            The Amazon Resource Name ( ARN) associated with the GameLift fleet that this game session is running on.

          • 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").

          • CurrentPlayerSessionCount (integer) --

            Number of players currently in the game session.

          • MaximumPlayerSessionCount (integer) --

            The maximum number of players that can be connected simultaneously to the game session.

          • Status (string) --

            Current status of the game session. A game session must have an ACTIVE status to have player sessions.

          • StatusReason (string) --

            Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.

          • GameProperties (list) --

            Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). You can search for active game sessions based on this custom data with SearchGameSessions.

            • (dict) --

              Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session. For example, a game property might specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session. For more information, see the Amazon GameLift Developer Guide.

              • Key (string) --

                The game property identifier.

              • Value (string) --

                The game property value.

          • IpAddress (string) --

            IP address of the instance that is running the game session. When connecting to a Amazon GameLift game server, a client needs to reference an IP address (or DNS name) and port number.

          • DnsName (string) --

            DNS identifier assigned to the instance that is running the game session. Values have the following format:

            • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.

            • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.)

            When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

          • Port (integer) --

            Port number for the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.

          • PlayerSessionCreationPolicy (string) --

            Indicates whether or not the game session is accepting new players.

          • CreatorId (string) --

            A unique identifier for a player. This ID is used to enforce a resource protection policy (if one exists), that limits the number of game sessions a player can create.

          • GameSessionData (string) --

            Set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session).

          • MatchmakerData (string) --

            Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formatted as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data. Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill).

        • ProtectionPolicy (string) --

          Current status of protection for the game session.

          • 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.

    • 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.

DescribeGameSessions (updated) Link ¶
Changes (response)
{'GameSessions': {'FleetArn': 'string'}}

Retrieves a set of one or more game sessions. Request a specific game session or request all game sessions on a fleet. Alternatively, use SearchGameSessions to request a set of active game sessions that are filtered by certain criteria. To retrieve protection policy settings for game sessions, use DescribeGameSessionDetails.

To get game sessions, specify one of the following: game session ID, fleet ID, or alias ID. You can filter this request by game session status. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a GameSession object is returned for each game session matching the request.

Available in Amazon GameLift Local.

  • CreateGameSession

  • DescribeGameSessions

  • DescribeGameSessionDetails

  • SearchGameSessions

  • UpdateGameSession

  • GetGameSessionLogUrl

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.describe_game_sessions(
    FleetId='string',
    GameSessionId='string',
    AliasId='string',
    StatusFilter='string',
    Limit=123,
    NextToken='string'
)
type FleetId:

string

param FleetId:

A unique identifier for a fleet to retrieve all game sessions for. You can use either the fleet ID or ARN value.

type GameSessionId:

string

param GameSessionId:

A unique identifier for the game session to retrieve.

type AliasId:

string

param AliasId:

A unique identifier for an alias associated with the fleet to retrieve all game sessions for. You can use either the alias ID or ARN value.

type StatusFilter:

string

param StatusFilter:

Game session status to filter results on. Possible game session statuses include ACTIVE, TERMINATED, ACTIVATING, and TERMINATING (the last two are transitory).

type Limit:

integer

param Limit:

The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.

type NextToken:

string

param NextToken:

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.

rtype:

dict

returns:

Response Syntax

{
    'GameSessions': [
        {
            'GameSessionId': 'string',
            'Name': 'string',
            'FleetId': 'string',
            'FleetArn': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'TerminationTime': datetime(2015, 1, 1),
            'CurrentPlayerSessionCount': 123,
            'MaximumPlayerSessionCount': 123,
            'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR',
            'StatusReason': 'INTERRUPTED',
            'GameProperties': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'IpAddress': 'string',
            'DnsName': 'string',
            'Port': 123,
            'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL',
            'CreatorId': 'string',
            'GameSessionData': 'string',
            'MatchmakerData': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSessions (list) --

      A collection of objects containing game session properties for each session matching the request.

      • (dict) --

        Properties describing a game session.

        A game session in ACTIVE status can host players. When a game session ends, its status is set to TERMINATED.

        Once the session ends, the game session object is retained for 30 days. This means you can reuse idempotency token values after this time. Game session logs are retained for 14 days.

        • CreateGameSession

        • DescribeGameSessions

        • DescribeGameSessionDetails

        • SearchGameSessions

        • UpdateGameSession

        • GetGameSessionLogUrl

        • Game session placements

          • StartGameSessionPlacement

          • DescribeGameSessionPlacement

          • StopGameSessionPlacement

        • GameSessionId (string) --

          A unique identifier for the game session. A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token>.

        • Name (string) --

          A descriptive label that is associated with a game session. Session names do not need to be unique.

        • FleetId (string) --

          A unique identifier for a fleet that the game session is running on.

        • FleetArn (string) --

          The Amazon Resource Name ( ARN) associated with the GameLift fleet that this game session is running on.

        • 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").

        • CurrentPlayerSessionCount (integer) --

          Number of players currently in the game session.

        • MaximumPlayerSessionCount (integer) --

          The maximum number of players that can be connected simultaneously to the game session.

        • Status (string) --

          Current status of the game session. A game session must have an ACTIVE status to have player sessions.

        • StatusReason (string) --

          Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.

        • GameProperties (list) --

          Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). You can search for active game sessions based on this custom data with SearchGameSessions.

          • (dict) --

            Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session. For example, a game property might specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session. For more information, see the Amazon GameLift Developer Guide.

            • Key (string) --

              The game property identifier.

            • Value (string) --

              The game property value.

        • IpAddress (string) --

          IP address of the instance that is running the game session. When connecting to a Amazon GameLift game server, a client needs to reference an IP address (or DNS name) and port number.

        • DnsName (string) --

          DNS identifier assigned to the instance that is running the game session. Values have the following format:

          • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.

          • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.)

          When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

        • Port (integer) --

          Port number for the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.

        • PlayerSessionCreationPolicy (string) --

          Indicates whether or not the game session is accepting new players.

        • CreatorId (string) --

          A unique identifier for a player. This ID is used to enforce a resource protection policy (if one exists), that limits the number of game sessions a player can create.

        • GameSessionData (string) --

          Set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session).

        • MatchmakerData (string) --

          Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formatted as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data. Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill).

    • 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.

DescribeMatchmaking (updated) Link ¶
Changes (response)
{'TicketList': {'ConfigurationArn': 'string'}}

Retrieves one or more matchmaking tickets. Use this operation to retrieve ticket information, including status and--once a successful match is made--acquire connection information for the resulting new game session.

You can use this operation to track the progress of matchmaking requests (through polling) as an alternative to using event notifications. See more details on tracking matchmaking requests through polling or notifications in StartMatchmaking.

To request matchmaking tickets, provide a list of up to 10 ticket IDs. If the request is successful, a ticket object is returned for each requested ID that currently exists.

Learn more

Add FlexMatch to a Game Client

Set Up FlexMatch Event Notification

Related operations

  • StartMatchmaking

  • DescribeMatchmaking

  • StopMatchmaking

  • AcceptMatch

  • StartMatchBackfill

See also: AWS API Documentation

Request Syntax

client.describe_matchmaking(
    TicketIds=[
        'string',
    ]
)
type TicketIds:

list

param TicketIds:

[REQUIRED]

A unique identifier for a matchmaking ticket. You can include up to 10 ID values.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'TicketList': [
        {
            'TicketId': 'string',
            'ConfigurationName': 'string',
            'ConfigurationArn': 'string',
            'Status': 'CANCELLED'|'COMPLETED'|'FAILED'|'PLACING'|'QUEUED'|'REQUIRES_ACCEPTANCE'|'SEARCHING'|'TIMED_OUT',
            'StatusReason': 'string',
            'StatusMessage': 'string',
            'StartTime': datetime(2015, 1, 1),
            'EndTime': datetime(2015, 1, 1),
            'Players': [
                {
                    'PlayerId': 'string',
                    'PlayerAttributes': {
                        'string': {
                            'S': 'string',
                            'N': 123.0,
                            'SL': [
                                'string',
                            ],
                            'SDM': {
                                'string': 123.0
                            }
                        }
                    },
                    'Team': 'string',
                    'LatencyInMs': {
                        'string': 123
                    }
                },
            ],
            'GameSessionConnectionInfo': {
                'GameSessionArn': 'string',
                'IpAddress': 'string',
                'DnsName': 'string',
                'Port': 123,
                'MatchedPlayerSessions': [
                    {
                        'PlayerId': 'string',
                        'PlayerSessionId': 'string'
                    },
                ]
            },
            'EstimatedWaitTime': 123
        },
    ]
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • TicketList (list) --

      A collection of existing matchmaking ticket objects matching the request.

      • (dict) --

        Ticket generated to track the progress of a matchmaking request. Each ticket is uniquely identified by a ticket ID, supplied by the requester, when creating a matchmaking request with StartMatchmaking. Tickets can be retrieved by calling DescribeMatchmaking with the ticket ID.

        • TicketId (string) --

          A unique identifier for a matchmaking ticket.

        • ConfigurationName (string) --

          Name of the MatchmakingConfiguration that is used with this ticket. Matchmaking configurations determine how players are grouped into a match and how a new game session is created for the match.

        • ConfigurationArn (string) --

          The Amazon Resource Name ( ARN) associated with the GameLift matchmaking configuration resource that is used with this ticket.

        • Status (string) --

          Current status of the matchmaking request.

          • QUEUED -- The matchmaking request has been received and is currently waiting to be processed.

          • SEARCHING -- The matchmaking request is currently being processed.

          • REQUIRES_ACCEPTANCE -- A match has been proposed and the players must accept the match (see AcceptMatch). This status is used only with requests that use a matchmaking configuration with a player acceptance requirement.

          • PLACING -- The FlexMatch engine has matched players and is in the process of placing a new game session for the match.

          • COMPLETED -- Players have been matched and a game session is ready to host the players. A ticket in this state contains the necessary connection information for players.

          • FAILED -- The matchmaking request was not completed.

          • CANCELLED -- The matchmaking request was canceled. This may be the result of a call to StopMatchmaking or a proposed match that one or more players failed to accept.

          • TIMED_OUT -- The matchmaking request was not successful within the duration specified in the matchmaking configuration.

        • StatusReason (string) --

          Code to explain the current status. For example, a status reason may indicate when a ticket has returned to SEARCHING status after a proposed match fails to receive player acceptances.

        • StatusMessage (string) --

          Additional information about the current status.

        • StartTime (datetime) --

          Time stamp indicating when this matchmaking request was received. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

        • EndTime (datetime) --

          Time stamp indicating when this matchmaking request stopped being processed due to success, failure, or cancellation. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

        • Players (list) --

          A set of Player objects, each representing a player to find matches for. Players are identified by a unique player ID and may include latency data for use during matchmaking. If the ticket is in status COMPLETED, the Player objects include the team the players were assigned to in the resulting match.

          • (dict) --

            Represents a player in matchmaking. When starting a matchmaking request, a player has a player ID, attributes, and may have latency data. Team information is added after a match has been successfully completed.

            • PlayerId (string) --

              A unique identifier for a player

            • PlayerAttributes (dict) --

              A collection of key:value pairs containing player information for use in matchmaking. Player attribute keys must match the playerAttributes used in a matchmaking rule set. Example: "PlayerAttributes": {"skill": {"N": "23"}, "gameMode": {"S": "deathmatch"}}.

              • (string) --

                • (dict) --

                  Values for use in Player attribute key-value pairs. This object lets you specify an attribute value using any of the valid data types: string, number, string array, or data map. Each AttributeValue object can use only one of the available properties.

                  • S (string) --

                    For single string values. Maximum string length is 100 characters.

                  • N (float) --

                    For number values, expressed as double.

                  • SL (list) --

                    For a list of up to 10 strings. Maximum length for each string is 100 characters. Duplicate values are not recognized; all occurrences of the repeated value after the first of a repeated value are ignored.

                    • (string) --

                  • SDM (dict) --

                    For a map of up to 10 data type:value pairs. Maximum length for each string value is 100 characters.

                    • (string) --

                      • (float) --

            • Team (string) --

              Name of the team that the player is assigned to in a match. Team names are defined in a matchmaking rule set.

            • LatencyInMs (dict) --

              Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connected to AWS Regions. If this property is present, FlexMatch considers placing the match only in Regions for which latency is reported.

              If a matchmaker has a rule that evaluates player latency, players must report latency in order to be matched. If no latency is reported in this scenario, FlexMatch assumes that no Regions are available to the player and the ticket is not matchable.

              • (string) --

                • (integer) --

        • GameSessionConnectionInfo (dict) --

          Identifier and connection information of the game session created for the match. This information is added to the ticket only after the matchmaking request has been successfully completed.

          • GameSessionArn (string) --

            Amazon Resource Name ( ARN) that is assigned to a game session and uniquely identifies it.

          • IpAddress (string) --

            IP address of the instance that is running the game session. When connecting to a Amazon GameLift game server, a client needs to reference an IP address (or DNS name) and port number.

          • DnsName (string) --

            DNS identifier assigned to the instance that is running the game session. Values have the following format:

            • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.

            • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.)

            When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

          • Port (integer) --

            Port number for the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.

          • MatchedPlayerSessions (list) --

            A collection of player session IDs, one for each player ID that was included in the original matchmaking request.

            • (dict) --

              Represents a new player session that is created as a result of a successful FlexMatch match. A successful match automatically creates new player sessions for every player ID in the original matchmaking request.

              When players connect to the match's game session, they must include both player ID and player session ID in order to claim their assigned player slot.

              • PlayerId (string) --

                A unique identifier for a player

              • PlayerSessionId (string) --

                A unique identifier for a player session

        • EstimatedWaitTime (integer) --

          Average amount of time (in seconds) that players are currently waiting for a match. If there is not enough recent data, this property may be empty.

DescribeMatchmakingConfigurations (updated) Link ¶
Changes (response)
{'Configurations': {'ConfigurationArn': 'string', 'RuleSetArn': 'string'}}

Retrieves the details of FlexMatch matchmaking configurations. With this operation, you have the following options: (1) retrieve all existing configurations, (2) provide the names of one or more configurations to retrieve, or (3) retrieve all configurations that use a specified rule set name. When requesting multiple items, use the pagination parameters to retrieve results as a set of sequential pages. If successful, a configuration is returned for each requested name. When specifying a list of names, only configurations that currently exist are returned.

Learn more

Setting Up FlexMatch Matchmakers

Related operations

  • CreateMatchmakingConfiguration

  • DescribeMatchmakingConfigurations

  • UpdateMatchmakingConfiguration

  • DeleteMatchmakingConfiguration

  • CreateMatchmakingRuleSet

  • DescribeMatchmakingRuleSets

  • ValidateMatchmakingRuleSet

  • DeleteMatchmakingRuleSet

See also: AWS API Documentation

Request Syntax

client.describe_matchmaking_configurations(
    Names=[
        'string',
    ],
    RuleSetName='string',
    Limit=123,
    NextToken='string'
)
type Names:

list

param Names:

A unique identifier for a matchmaking configuration(s) to retrieve. You can use either the configuration name or ARN value. To request all existing configurations, leave this parameter empty.

  • (string) --

type RuleSetName:

string

param RuleSetName:

A unique identifier for a matchmaking rule set. You can use either the rule set name or ARN value. Use this parameter to retrieve all matchmaking configurations that use this rule set.

type Limit:

integer

param Limit:

The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages. This parameter is limited to 10.

type NextToken:

string

param NextToken:

A 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.

rtype:

dict

returns:

Response Syntax

{
    'Configurations': [
        {
            'Name': 'string',
            'ConfigurationArn': 'string',
            'Description': 'string',
            'GameSessionQueueArns': [
                'string',
            ],
            'RequestTimeoutSeconds': 123,
            'AcceptanceTimeoutSeconds': 123,
            'AcceptanceRequired': True|False,
            'RuleSetName': 'string',
            'RuleSetArn': 'string',
            'NotificationTarget': 'string',
            'AdditionalPlayerCount': 123,
            'CustomEventData': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'GameProperties': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'GameSessionData': 'string',
            'BackfillMode': 'AUTOMATIC'|'MANUAL'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • Configurations (list) --

      A collection of requested matchmaking configurations.

      • (dict) --

        Guidelines for use with FlexMatch to match players into games. All matchmaking requests must specify a matchmaking configuration.

        • Name (string) --

          A unique identifier for a matchmaking configuration. This name is used to identify the configuration associated with a matchmaking request or ticket.

        • ConfigurationArn (string) --

          Amazon Resource Name ( ARN) that is assigned to a GameLift matchmaking configuration resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift configuration ARN, the resource ID matches the Name value.

        • Description (string) --

          A descriptive label that is associated with matchmaking configuration.

        • GameSessionQueueArns (list) --

          Amazon Resource Name ( ARN) that is assigned to a GameLift game session queue resource and uniquely identifies it. ARNs are unique across all Regions. GameLift uses the listed queues when placing game sessions for matches that are created with this matchmaking configuration. Queues can be located in any Region.

          • (string) --

        • RequestTimeoutSeconds (integer) --

          The maximum duration, in seconds, that a matchmaking ticket can remain in process before timing out. Requests that fail due to timing out can be resubmitted as needed.

        • AcceptanceTimeoutSeconds (integer) --

          The length of time (in seconds) to wait for players to accept a proposed match. If any player rejects the match or fails to accept before the timeout, the ticket continues to look for an acceptable match.

        • AcceptanceRequired (boolean) --

          A flag that indicates whether a match that was created with this configuration must be accepted by the matched players. To require acceptance, set to TRUE.

        • RuleSetName (string) --

          A unique identifier for a matchmaking rule set to use with this configuration. A matchmaking configuration can only use rule sets that are defined in the same Region.

        • RuleSetArn (string) --

          The Amazon Resource Name ( ARN) associated with the GameLift matchmaking rule set resource that this configuration uses.

        • NotificationTarget (string) --

          An SNS topic ARN that is set up to receive matchmaking notifications.

        • AdditionalPlayerCount (integer) --

          The number of player slots in a match to keep open for future players. For example, assume that the configuration's rule set specifies a match for a single 12-person team. If the additional player count is set to 2, only 10 players are initially selected for the match.

        • CustomEventData (string) --

          Information to attach to all events related to the matchmaking configuration.

        • CreationTime (datetime) --

          The time stamp indicating when this data object was created. The format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

        • GameProperties (list) --

          A set of custom properties for a game session, formatted as key-value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). This information is added to the new GameSession object that is created for a successful match.

          • (dict) --

            Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session. For example, a game property might specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session. For more information, see the Amazon GameLift Developer Guide.

            • Key (string) --

              The game property identifier.

            • Value (string) --

              The game property value.

        • GameSessionData (string) --

          A set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). This information is added to the new GameSession object that is created for a successful match.

        • BackfillMode (string) --

          The method used to backfill game sessions created with this matchmaking configuration. MANUAL indicates that the game makes backfill requests or does not use the match backfill feature. AUTOMATIC indicates that GameLift creates StartMatchBackfill requests whenever a game session has one or more open slots. Learn more about manual and automatic backfill in Backfill Existing Games with FlexMatch.

    • NextToken (string) --

      A 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.

DescribeMatchmakingRuleSets (updated) Link ¶
Changes (response)
{'RuleSets': {'RuleSetArn': 'string'}}

Retrieves the details for FlexMatch matchmaking rule sets. You can request all existing rule sets for the Region, or provide a list of one or more rule set names. When requesting multiple items, use the pagination parameters to retrieve results as a set of sequential pages. If successful, a rule set is returned for each requested name.

Learn more

Related operations

  • CreateMatchmakingConfiguration

  • DescribeMatchmakingConfigurations

  • UpdateMatchmakingConfiguration

  • DeleteMatchmakingConfiguration

  • CreateMatchmakingRuleSet

  • DescribeMatchmakingRuleSets

  • ValidateMatchmakingRuleSet

  • DeleteMatchmakingRuleSet

See also: AWS API Documentation

Request Syntax

client.describe_matchmaking_rule_sets(
    Names=[
        'string',
    ],
    Limit=123,
    NextToken='string'
)
type Names:

list

param Names:

A list of one or more matchmaking rule set names to retrieve details for. (Note: The rule set name is different from the optional "name" field in the rule set body.) You can use either the rule set name or ARN value.

  • (string) --

type Limit:

integer

param Limit:

The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.

type NextToken:

string

param NextToken:

A 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.

rtype:

dict

returns:

Response Syntax

{
    'RuleSets': [
        {
            'RuleSetName': 'string',
            'RuleSetArn': 'string',
            'RuleSetBody': 'string',
            'CreationTime': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • RuleSets (list) --

      A collection of requested matchmaking rule set objects.

      • (dict) --

        Set of rule statements, used with FlexMatch, that determine how to build your player matches. Each rule set describes a type of group to be created and defines the parameters for acceptable player matches. Rule sets are used in MatchmakingConfiguration objects.

        A rule set may define the following elements for a match. For detailed information and examples showing how to construct a rule set, see Build a FlexMatch Rule Set.

        • Teams -- Required. A rule set must define one or multiple teams for the match and set minimum and maximum team sizes. For example, a rule set might describe a 4x4 match that requires all eight slots to be filled.

        • Player attributes -- Optional. These attributes specify a set of player characteristics to evaluate when looking for a match. Matchmaking requests that use a rule set with player attributes must provide the corresponding attribute values. For example, an attribute might specify a player's skill or level.

        • Rules -- Optional. Rules define how to evaluate potential players for a match based on player attributes. A rule might specify minimum requirements for individual players, teams, or entire matches. For example, a rule might require each player to meet a certain skill level, each team to have at least one player in a certain role, or the match to have a minimum average skill level. or may describe an entire group--such as all teams must be evenly matched or have at least one player in a certain role.

        • Expansions -- Optional. Expansions allow you to relax the rules after a period of time when no acceptable matches are found. This feature lets you balance getting players into games in a reasonable amount of time instead of making them wait indefinitely for the best possible match. For example, you might use an expansion to increase the maximum skill variance between players after 30 seconds.

        • RuleSetName (string) --

          A unique identifier for a matchmaking rule set

        • RuleSetArn (string) --

          Amazon Resource Name ( ARN) that is assigned to a GameLift matchmaking rule set resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift rule set ARN, the resource ID matches the RuleSetName value.

        • RuleSetBody (string) --

          A collection of matchmaking rules, formatted as a JSON string. Comments are not allowed in JSON, but most elements support a description field.

        • CreationTime (datetime) --

          The time stamp indicating when this data object was created. The format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

    • NextToken (string) --

      A 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.

DescribePlayerSessions (updated) Link ¶
Changes (response)
{'PlayerSessions': {'FleetArn': 'string'}}

Retrieves properties for one or more player sessions. This action can be used in several ways: (1) provide a PlayerSessionId to request properties for a specific player session; (2) provide a GameSessionId to request properties for all player sessions in the specified game session; (3) provide a PlayerId to request properties for all player sessions of a specified player.

To get game session record(s), specify only one of the following: a player session ID, a game session ID, or a player ID. You can filter this request by player session status. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a PlayerSession object is returned for each session matching the request.

Available in Amazon GameLift Local.

  • CreatePlayerSession

  • CreatePlayerSessions

  • DescribePlayerSessions

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.describe_player_sessions(
    GameSessionId='string',
    PlayerId='string',
    PlayerSessionId='string',
    PlayerSessionStatusFilter='string',
    Limit=123,
    NextToken='string'
)
type GameSessionId:

string

param GameSessionId:

A unique identifier for the game session to retrieve player sessions for.

type PlayerId:

string

param PlayerId:

A unique identifier for a player to retrieve player sessions for.

type PlayerSessionId:

string

param PlayerSessionId:

A unique identifier for a player session to retrieve.

type PlayerSessionStatusFilter:

string

param PlayerSessionStatusFilter:

Player session status to filter results on.

Possible player session statuses include the following:

  • RESERVED -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.

  • ACTIVE -- The player has been validated by the server process and is currently connected.

  • COMPLETED -- The player connection has been dropped.

  • TIMEDOUT -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).

type Limit:

integer

param Limit:

The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages. If a player session ID is specified, this parameter is ignored.

type NextToken:

string

param NextToken:

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. If a player session ID is specified, this parameter is ignored.

rtype:

dict

returns:

Response Syntax

{
    'PlayerSessions': [
        {
            'PlayerSessionId': 'string',
            'PlayerId': 'string',
            'GameSessionId': 'string',
            'FleetId': 'string',
            'FleetArn': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'TerminationTime': datetime(2015, 1, 1),
            'Status': 'RESERVED'|'ACTIVE'|'COMPLETED'|'TIMEDOUT',
            'IpAddress': 'string',
            'DnsName': 'string',
            'Port': 123,
            'PlayerData': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • PlayerSessions (list) --

      A collection of objects containing properties for each player session that matches the request.

      • (dict) --

        Properties describing a player session. Player session objects are created either by creating a player session for a specific game session, or as part of a game session placement. A player session represents either a player reservation for a game session (status RESERVED) or actual player activity in a game session (status ACTIVE). A player session object (including player data) is automatically passed to a game session when the player connects to the game session and is validated.

        When a player disconnects, the player session status changes to COMPLETED. Once the session ends, the player session object is retained for 30 days and then removed.

        • CreatePlayerSession

        • CreatePlayerSessions

        • DescribePlayerSessions

        • Game session placements

          • StartGameSessionPlacement

          • DescribeGameSessionPlacement

          • StopGameSessionPlacement

        • PlayerSessionId (string) --

          A unique identifier for a player session.

        • PlayerId (string) --

          A unique identifier for a player that is associated with this player session.

        • GameSessionId (string) --

          A unique identifier for the game session that the player session is connected to.

        • FleetId (string) --

          A unique identifier for a fleet that the player's game session is running on.

        • FleetArn (string) --

          The Amazon Resource Name ( ARN) associated with the GameLift fleet that the player's game session is running on.

        • 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 player session.

          Possible player session statuses include the following:

          • RESERVED -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.

          • ACTIVE -- The player has been validated by the server process and is currently connected.

          • COMPLETED -- The player connection has been dropped.

          • TIMEDOUT -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).

        • IpAddress (string) --

          IP address of the instance that is running the game session. When connecting to a Amazon GameLift game server, a client needs to reference an IP address (or DNS name) and port number.

        • DnsName (string) --

          DNS identifier assigned to the instance that is running the game session. Values have the following format:

          • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.

          • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.)

          When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

        • Port (integer) --

          Port number for the game session. To connect to a Amazon GameLift server process, an app needs both the IP address and port number.

        • PlayerData (string) --

          Developer-defined information related to a player. Amazon GameLift does not use this data, so it can be formatted as needed for use in the game.

    • 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.

DescribeScript (updated) Link ¶
Changes (response)
{'Script': {'ScriptArn': 'string'}}

Retrieves properties for a Realtime script.

To request a script record, specify the script ID. If successful, an object containing the script properties is returned.

Learn more

Amazon GameLift Realtime Servers

Related operations

  • CreateScript

  • ListScripts

  • DescribeScript

  • UpdateScript

  • DeleteScript

See also: AWS API Documentation

Request Syntax

client.describe_script(
    ScriptId='string'
)
type ScriptId:

string

param ScriptId:

[REQUIRED]

A unique identifier for a Realtime script to retrieve properties for. You can use either the script ID or ARN value.

rtype:

dict

returns:

Response Syntax

{
    'Script': {
        'ScriptId': 'string',
        'ScriptArn': 'string',
        'Name': 'string',
        'Version': 'string',
        'SizeOnDisk': 123,
        'CreationTime': datetime(2015, 1, 1),
        'StorageLocation': {
            'Bucket': 'string',
            'Key': 'string',
            'RoleArn': 'string',
            'ObjectVersion': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • Script (dict) --

      A set of properties describing the requested script.

      • ScriptId (string) --

        A unique identifier for a Realtime script

      • ScriptArn (string) --

        Amazon Resource Name ( ARN) that is assigned to a GameLift script resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift script ARN, the resource ID matches the ScriptId value.

      • Name (string) --

        A descriptive label that is associated with a script. Script names do not need to be unique.

      • Version (string) --

        The version that is associated with a build or script. Version strings do not need to be unique.

      • SizeOnDisk (integer) --

        The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 location, this value remains at "0".

      • CreationTime (datetime) --

        A time stamp indicating when this data object was created. The format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • StorageLocation (dict) --

        The location in Amazon S3 where build or script files are stored for access by Amazon GameLift. This location is specified in CreateBuild, CreateScript, and UpdateScript requests.

        • Bucket (string) --

          An Amazon S3 bucket identifier. This is the name of the S3 bucket.

        • Key (string) --

          The name of the zip file that contains the build files or script files.

        • RoleArn (string) --

          The Amazon Resource Name ( ARN) for an IAM role that allows Amazon GameLift to access the S3 bucket.

        • ObjectVersion (string) --

          The version of the file, if object versioning is turned on for the bucket. Amazon GameLift uses this information when retrieving files from an S3 bucket that you own. Use this parameter to specify a specific version of the file. If not set, the latest version of the file is retrieved.

DescribeVpcPeeringConnections (updated) Link ¶
Changes (response)
{'VpcPeeringConnections': {'FleetArn': 'string'}}

Retrieves information on VPC peering connections. Use this operation to get peering information for all fleets or for one specific fleet ID.

To retrieve connection information, call this operation from the AWS account that is used to manage the Amazon GameLift fleets. Specify a fleet ID or leave the parameter empty to retrieve all connection records. If successful, the retrieved information includes both active and pending connections. Active connections identify the IpV4 CIDR block that the VPC uses to connect.

  • CreateVpcPeeringAuthorization

  • DescribeVpcPeeringAuthorizations

  • DeleteVpcPeeringAuthorization

  • CreateVpcPeeringConnection

  • DescribeVpcPeeringConnections

  • DeleteVpcPeeringConnection

See also: AWS API Documentation

Request Syntax

client.describe_vpc_peering_connections(
    FleetId='string'
)
type FleetId:

string

param FleetId:

A unique identifier for a fleet. You can use either the fleet ID or ARN value.

rtype:

dict

returns:

Response Syntax

{
    'VpcPeeringConnections': [
        {
            'FleetId': 'string',
            'FleetArn': 'string',
            'IpV4CidrBlock': 'string',
            'VpcPeeringConnectionId': 'string',
            'Status': {
                'Code': 'string',
                'Message': 'string'
            },
            'PeerVpcId': 'string',
            'GameLiftVpcId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • VpcPeeringConnections (list) --

      A collection of VPC peering connection records that match the request.

      • (dict) --

        Represents a peering connection between a VPC on one of your AWS accounts and the VPC for your Amazon GameLift fleets. This record may be for an active peering connection or a pending connection that has not yet been established.

        • CreateVpcPeeringAuthorization

        • DescribeVpcPeeringAuthorizations

        • DeleteVpcPeeringAuthorization

        • CreateVpcPeeringConnection

        • DescribeVpcPeeringConnections

        • DeleteVpcPeeringConnection

        • FleetId (string) --

          A unique identifier for a fleet. This ID determines the ID of the Amazon GameLift VPC for your fleet.

        • FleetArn (string) --

          The Amazon Resource Name ( ARN) associated with the GameLift fleet resource for this connection.

        • IpV4CidrBlock (string) --

          CIDR block of IPv4 addresses assigned to the VPC peering connection for the GameLift VPC. The peered VPC also has an IPv4 CIDR block associated with it; these blocks cannot overlap or the peering connection cannot be created.

        • VpcPeeringConnectionId (string) --

          A unique identifier that is automatically assigned to the connection record. This ID is referenced in VPC peering connection events, and is used when deleting a connection with DeleteVpcPeeringConnection.

        • Status (dict) --

          The status information about the connection. Status indicates if a connection is pending, successful, or failed.

          • Code (string) --

            Code indicating the status of a VPC peering connection.

          • Message (string) --

            Additional messaging associated with the connection status.

        • PeerVpcId (string) --

          A 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.

        • GameLiftVpcId (string) --

          A unique identifier for the VPC that contains the Amazon GameLift fleet for this connection. This VPC is managed by Amazon GameLift and does not appear in your AWS account.

ListBuilds (updated) Link ¶
Changes (response)
{'Builds': {'BuildArn': 'string'}}

Retrieves build records for all builds associated with the AWS account in use. You can limit results to builds that are in a specific status by using the Status parameter. Use the pagination parameters to retrieve results in a set of sequential pages.

Learn more

Working with Builds

Related operations

  • CreateBuild

  • ListBuilds

  • DescribeBuild

  • UpdateBuild

  • DeleteBuild

See also: AWS API Documentation

Request Syntax

client.list_builds(
    Status='INITIALIZED'|'READY'|'FAILED',
    Limit=123,
    NextToken='string'
)
type Status:

string

param Status:

Build status to filter results by. To retrieve all builds, leave this parameter empty.

Possible build statuses include the following:

  • INITIALIZED -- A new build has been defined, but no files have been uploaded. You cannot create fleets for builds that are in this status. When a build is successfully created, the build status is set to this value.

  • READY -- The game build has been successfully uploaded. You can now create new fleets for this build.

  • FAILED -- The game build upload failed. You cannot create new fleets for this build.

type Limit:

integer

param Limit:

The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.

type NextToken:

string

param NextToken:

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.

rtype:

dict

returns:

Response Syntax

{
    'Builds': [
        {
            'BuildId': 'string',
            'BuildArn': 'string',
            'Name': 'string',
            'Version': 'string',
            'Status': 'INITIALIZED'|'READY'|'FAILED',
            'SizeOnDisk': 123,
            'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX'|'AMAZON_LINUX_2',
            'CreationTime': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • Builds (list) --

      A collection of build records that match the request.

      • (dict) --

        Properties describing a custom game build.

        Related operations

        • CreateBuild

        • ListBuilds

        • DescribeBuild

        • UpdateBuild

        • DeleteBuild

        • BuildId (string) --

          A unique identifier for a build.

        • BuildArn (string) --

          Amazon Resource Name ( ARN) that is assigned to a GameLift build resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift build ARN, the resource ID matches the BuildId value.

        • Name (string) --

          A descriptive label that is associated with a build. Build names do not need to be unique. It can be set using CreateBuild or UpdateBuild.

        • Version (string) --

          Version information that is associated with a build or script. Version strings do not need to be unique. This value can be set using CreateBuild or UpdateBuild.

        • Status (string) --

          Current status of the build.

          Possible build statuses include the following:

          • INITIALIZED -- A new build has been defined, but no files have been uploaded. You cannot create fleets for builds that are in this status. When a build is successfully created, the build status is set to this value.

          • READY -- The game build has been successfully uploaded. You can now create new fleets for this build.

          • FAILED -- The game build upload failed. You cannot create new fleets for this build.

        • SizeOnDisk (integer) --

          File size of the uploaded game build, expressed in bytes. When the build status is INITIALIZED, this value is 0.

        • OperatingSystem (string) --

          Operating system that the game server binaries are built to run on. This value determines the type of fleet resources that you can use for this build.

        • 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").

    • 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.

ListScripts (updated) Link ¶
Changes (response)
{'Scripts': {'ScriptArn': 'string'}}

Retrieves script records for all Realtime scripts that are associated with the AWS account in use.

Learn more

Amazon GameLift Realtime Servers

Related operations

  • CreateScript

  • ListScripts

  • DescribeScript

  • UpdateScript

  • DeleteScript

See also: AWS API Documentation

Request Syntax

client.list_scripts(
    Limit=123,
    NextToken='string'
)
type Limit:

integer

param Limit:

The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.

type NextToken:

string

param NextToken:

A 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.

rtype:

dict

returns:

Response Syntax

{
    'Scripts': [
        {
            'ScriptId': 'string',
            'ScriptArn': 'string',
            'Name': 'string',
            'Version': 'string',
            'SizeOnDisk': 123,
            'CreationTime': datetime(2015, 1, 1),
            'StorageLocation': {
                'Bucket': 'string',
                'Key': 'string',
                'RoleArn': 'string',
                'ObjectVersion': 'string'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Scripts (list) --

      A set of properties describing the requested script.

      • (dict) --

        Properties describing a Realtime script.

        Related operations

        • CreateScript

        • ListScripts

        • DescribeScript

        • UpdateScript

        • DeleteScript

        • ScriptId (string) --

          A unique identifier for a Realtime script

        • ScriptArn (string) --

          Amazon Resource Name ( ARN) that is assigned to a GameLift script resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift script ARN, the resource ID matches the ScriptId value.

        • Name (string) --

          A descriptive label that is associated with a script. Script names do not need to be unique.

        • Version (string) --

          The version that is associated with a build or script. Version strings do not need to be unique.

        • SizeOnDisk (integer) --

          The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 location, this value remains at "0".

        • CreationTime (datetime) --

          A time stamp indicating when this data object was created. The format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

        • StorageLocation (dict) --

          The location in Amazon S3 where build or script files are stored for access by Amazon GameLift. This location is specified in CreateBuild, CreateScript, and UpdateScript requests.

          • Bucket (string) --

            An Amazon S3 bucket identifier. This is the name of the S3 bucket.

          • Key (string) --

            The name of the zip file that contains the build files or script files.

          • RoleArn (string) --

            The Amazon Resource Name ( ARN) for an IAM role that allows Amazon GameLift to access the S3 bucket.

          • ObjectVersion (string) --

            The version of the file, if object versioning is turned on for the bucket. Amazon GameLift uses this information when retrieving files from an S3 bucket that you own. Use this parameter to specify a specific version of the file. If not set, the latest version of the file is retrieved.

    • NextToken (string) --

      A 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.

ResolveAlias (updated) Link ¶
Changes (response)
{'FleetArn': 'string'}

Retrieves the fleet ID that an alias is currently pointing to.

  • CreateAlias

  • ListAliases

  • DescribeAlias

  • UpdateAlias

  • DeleteAlias

  • ResolveAlias

See also: AWS API Documentation

Request Syntax

client.resolve_alias(
    AliasId='string'
)
type AliasId:

string

param AliasId:

[REQUIRED]

The unique identifier of the alias that you want to retrieve a fleet ID for. You can use either the alias ID or ARN value.

rtype:

dict

returns:

Response Syntax

{
    'FleetId': 'string',
    'FleetArn': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • FleetId (string) --

      The fleet identifier that the alias is pointing to.

    • FleetArn (string) --

      The Amazon Resource Name ( ARN) associated with the GameLift fleet resource that this alias points to.

SearchGameSessions (updated) Link ¶
Changes (response)
{'GameSessions': {'FleetArn': 'string'}}

Retrieves all active game sessions that match a set of search criteria and sorts them in a specified order. You can search or sort by the following game session attributes:

  • gameSessionId -- A unique identifier for the game session. You can use either a GameSessionId or GameSessionArn value.

  • gameSessionName -- Name assigned to a game session. This value is set when requesting a new game session with CreateGameSession or updating with UpdateGameSession. Game session names do not need to be unique to a game session.

  • gameSessionProperties -- Custom data defined in a game session's GameProperty parameter. GameProperty values are stored as key:value pairs; the filter expression must indicate the key and a string to search the data values for. For example, to search for game sessions with custom data containing the key:value pair "gameMode:brawl", specify the following: gameSessionProperties.gameMode = "brawl". All custom data values are searched as strings.

  • maximumSessions -- Maximum number of player sessions allowed for a game session. This value is set when requesting a new game session with CreateGameSession or updating with UpdateGameSession.

  • creationTimeMillis -- Value indicating when a game session was created. It is expressed in Unix time as milliseconds.

  • playerSessionCount -- Number of players currently connected to a game session. This value changes rapidly as players join the session or drop out.

  • hasAvailablePlayerSessions -- Boolean value indicating whether a game session has reached its maximum number of players. It is highly recommended that all search requests include this filter attribute to optimize search performance and return only sessions that players can join.

To search or sort, specify either a fleet ID or an alias ID, and provide a search filter expression, a sort expression, or both. If successful, a collection of GameSession objects matching the request is returned. Use the pagination parameters to retrieve results as a set of sequential pages.

You can search for game sessions one fleet at a time only. To find game sessions across multiple fleets, you must search each fleet separately and combine the results. This search feature finds only game sessions that are in ACTIVE status. To locate games in statuses other than active, use DescribeGameSessionDetails.

  • CreateGameSession

  • DescribeGameSessions

  • DescribeGameSessionDetails

  • SearchGameSessions

  • UpdateGameSession

  • GetGameSessionLogUrl

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.search_game_sessions(
    FleetId='string',
    AliasId='string',
    FilterExpression='string',
    SortExpression='string',
    Limit=123,
    NextToken='string'
)
type FleetId:

string

param FleetId:

A unique identifier for a fleet to search for active game sessions. You can use either the fleet ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.

type AliasId:

string

param AliasId:

A unique identifier for an alias associated with the fleet to search for active game sessions. You can use either the alias ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.

type FilterExpression:

string

param FilterExpression:

String containing the search criteria for the session search. If no filter expression is included, the request returns results for all game sessions in the fleet that are in ACTIVE status.

A filter expression can contain one or multiple conditions. Each condition consists of the following:

  • Operand -- Name of a game session attribute. Valid values are gameSessionName, gameSessionId, gameSessionProperties, maximumSessions, creationTimeMillis, playerSessionCount, hasAvailablePlayerSessions.

  • Comparator -- Valid comparators are: =, <>, <, >, <=, >=.

  • Value -- Value to be searched for. Values may be numbers, boolean values (true/false) or strings depending on the operand. String values are case sensitive and must be enclosed in single quotes. Special characters must be escaped. Boolean and string values can only be used with the comparators = and <>. For example, the following filter expression searches on gameSessionName: " FilterExpression": "gameSessionName = 'Matt\\'s Awesome Game 1'".

To chain multiple conditions in a single expression, use the logical keywords AND, OR, and NOT and parentheses as needed. For example: x AND y AND NOT z, NOT (x OR y).

Session search evaluates conditions from left to right using the following precedence rules:

  • =, <>, <, >, <=, >=

  • Parentheses

  • NOT

  • AND

  • OR

For example, this filter expression retrieves game sessions hosting at least ten players that have an open player slot: "maximumSessions>=10 AND hasAvailablePlayerSessions=true".

type SortExpression:

string

param SortExpression:

Instructions on how to sort the search results. If no sort expression is included, the request returns results in random order. A sort expression consists of the following elements:

  • Operand -- Name of a game session attribute. Valid values are gameSessionName, gameSessionId, gameSessionProperties, maximumSessions, creationTimeMillis, playerSessionCount, hasAvailablePlayerSessions.

  • Order -- Valid sort orders are ASC (ascending) and DESC (descending).

For example, this sort expression returns the oldest active sessions first: "SortExpression": "creationTimeMillis ASC". Results with a null value for the sort operand are returned at the end of the list.

type Limit:

integer

param Limit:

The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages. The maximum number of results returned is 20, even if this value is not set or is set higher than 20.

type NextToken:

string

param NextToken:

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.

rtype:

dict

returns:

Response Syntax

{
    'GameSessions': [
        {
            'GameSessionId': 'string',
            'Name': 'string',
            'FleetId': 'string',
            'FleetArn': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'TerminationTime': datetime(2015, 1, 1),
            'CurrentPlayerSessionCount': 123,
            'MaximumPlayerSessionCount': 123,
            'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR',
            'StatusReason': 'INTERRUPTED',
            'GameProperties': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'IpAddress': 'string',
            'DnsName': 'string',
            'Port': 123,
            'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL',
            'CreatorId': 'string',
            'GameSessionData': 'string',
            'MatchmakerData': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSessions (list) --

      A collection of objects containing game session properties for each session matching the request.

      • (dict) --

        Properties describing a game session.

        A game session in ACTIVE status can host players. When a game session ends, its status is set to TERMINATED.

        Once the session ends, the game session object is retained for 30 days. This means you can reuse idempotency token values after this time. Game session logs are retained for 14 days.

        • CreateGameSession

        • DescribeGameSessions

        • DescribeGameSessionDetails

        • SearchGameSessions

        • UpdateGameSession

        • GetGameSessionLogUrl

        • Game session placements

          • StartGameSessionPlacement

          • DescribeGameSessionPlacement

          • StopGameSessionPlacement

        • GameSessionId (string) --

          A unique identifier for the game session. A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token>.

        • Name (string) --

          A descriptive label that is associated with a game session. Session names do not need to be unique.

        • FleetId (string) --

          A unique identifier for a fleet that the game session is running on.

        • FleetArn (string) --

          The Amazon Resource Name ( ARN) associated with the GameLift fleet that this game session is running on.

        • 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").

        • CurrentPlayerSessionCount (integer) --

          Number of players currently in the game session.

        • MaximumPlayerSessionCount (integer) --

          The maximum number of players that can be connected simultaneously to the game session.

        • Status (string) --

          Current status of the game session. A game session must have an ACTIVE status to have player sessions.

        • StatusReason (string) --

          Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.

        • GameProperties (list) --

          Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). You can search for active game sessions based on this custom data with SearchGameSessions.

          • (dict) --

            Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session. For example, a game property might specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session. For more information, see the Amazon GameLift Developer Guide.

            • Key (string) --

              The game property identifier.

            • Value (string) --

              The game property value.

        • IpAddress (string) --

          IP address of the instance that is running the game session. When connecting to a Amazon GameLift game server, a client needs to reference an IP address (or DNS name) and port number.

        • DnsName (string) --

          DNS identifier assigned to the instance that is running the game session. Values have the following format:

          • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.

          • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.)

          When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

        • Port (integer) --

          Port number for the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.

        • PlayerSessionCreationPolicy (string) --

          Indicates whether or not the game session is accepting new players.

        • CreatorId (string) --

          A unique identifier for a player. This ID is used to enforce a resource protection policy (if one exists), that limits the number of game sessions a player can create.

        • GameSessionData (string) --

          Set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session).

        • MatchmakerData (string) --

          Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formatted as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data. Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill).

    • 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.

StartMatchBackfill (updated) Link ¶
Changes (response)
{'MatchmakingTicket': {'ConfigurationArn': 'string'}}

Finds new players to fill open slots in an existing game session. This operation can be used to add players to matched games that start with fewer than the maximum number of players or to replace players when they drop out. By backfilling with the same matchmaker used to create the original match, you ensure that new players meet the match criteria and maintain a consistent experience throughout the game session. You can backfill a match anytime after a game session has been created.

To request a match backfill, specify a unique ticket ID, the existing game session's ARN, a matchmaking configuration, and a set of data that describes all current players in the game session. If successful, a match backfill ticket is created and returned with status set to QUEUED. The ticket is placed in the matchmaker's ticket pool and processed. Track the status of the ticket to respond as needed.

The process of finding backfill matches is essentially identical to the initial matchmaking process. The matchmaker searches the pool and groups tickets together to form potential matches, allowing only one backfill ticket per potential match. Once the a match is formed, the matchmaker creates player sessions for the new players. All tickets in the match are updated with the game session's connection information, and the GameSession object is updated to include matchmaker data on the new players. For more detail on how match backfill requests are processed, see How Amazon GameLift FlexMatch Works.

Learn more

Backfill Existing Games with FlexMatch

How GameLift FlexMatch Works

Related operations

  • StartMatchmaking

  • DescribeMatchmaking

  • StopMatchmaking

  • AcceptMatch

  • StartMatchBackfill

See also: AWS API Documentation

Request Syntax

client.start_match_backfill(
    TicketId='string',
    ConfigurationName='string',
    GameSessionArn='string',
    Players=[
        {
            'PlayerId': 'string',
            'PlayerAttributes': {
                'string': {
                    'S': 'string',
                    'N': 123.0,
                    'SL': [
                        'string',
                    ],
                    'SDM': {
                        'string': 123.0
                    }
                }
            },
            'Team': 'string',
            'LatencyInMs': {
                'string': 123
            }
        },
    ]
)
type TicketId:

string

param TicketId:

A unique identifier for a matchmaking ticket. If no ticket ID is specified here, Amazon GameLift will generate one in the form of a UUID. Use this identifier to track the match backfill ticket status and retrieve match results.

type ConfigurationName:

string

param ConfigurationName:

[REQUIRED]

Name of the matchmaker to use for this request. You can use either the configuration name or ARN value. The ARN of the matchmaker that was used with the original game session is listed in the GameSession object, MatchmakerData property.

type GameSessionArn:

string

param GameSessionArn:

[REQUIRED]

Amazon Resource Name ( ARN) that is assigned to a game session and uniquely identifies it. This is the same as the game session ID.

type Players:

list

param Players:

[REQUIRED]

Match information on all players that are currently assigned to the game session. This information is used by the matchmaker to find new players and add them to the existing game.

  • PlayerID, PlayerAttributes, Team -\- This information is maintained in the GameSession object, MatchmakerData property, for all players who are currently assigned to the game session. The matchmaker data is in JSON syntax, formatted as a string. For more details, see Match Data.

  • LatencyInMs -\- If the matchmaker uses player latency, include a latency value, in milliseconds, for the Region that the game session is currently in. Do not include latency values for any other Region.

  • (dict) --

    Represents a player in matchmaking. When starting a matchmaking request, a player has a player ID, attributes, and may have latency data. Team information is added after a match has been successfully completed.

    • PlayerId (string) --

      A unique identifier for a player

    • PlayerAttributes (dict) --

      A collection of key:value pairs containing player information for use in matchmaking. Player attribute keys must match the playerAttributes used in a matchmaking rule set. Example: "PlayerAttributes": {"skill": {"N": "23"}, "gameMode": {"S": "deathmatch"}}.

      • (string) --

        • (dict) --

          Values for use in Player attribute key-value pairs. This object lets you specify an attribute value using any of the valid data types: string, number, string array, or data map. Each AttributeValue object can use only one of the available properties.

          • S (string) --

            For single string values. Maximum string length is 100 characters.

          • N (float) --

            For number values, expressed as double.

          • SL (list) --

            For a list of up to 10 strings. Maximum length for each string is 100 characters. Duplicate values are not recognized; all occurrences of the repeated value after the first of a repeated value are ignored.

            • (string) --

          • SDM (dict) --

            For a map of up to 10 data type:value pairs. Maximum length for each string value is 100 characters.

            • (string) --

              • (float) --

    • Team (string) --

      Name of the team that the player is assigned to in a match. Team names are defined in a matchmaking rule set.

    • LatencyInMs (dict) --

      Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connected to AWS Regions. If this property is present, FlexMatch considers placing the match only in Regions for which latency is reported.

      If a matchmaker has a rule that evaluates player latency, players must report latency in order to be matched. If no latency is reported in this scenario, FlexMatch assumes that no Regions are available to the player and the ticket is not matchable.

      • (string) --

        • (integer) --

rtype:

dict

returns:

Response Syntax

{
    'MatchmakingTicket': {
        'TicketId': 'string',
        'ConfigurationName': 'string',
        'ConfigurationArn': 'string',
        'Status': 'CANCELLED'|'COMPLETED'|'FAILED'|'PLACING'|'QUEUED'|'REQUIRES_ACCEPTANCE'|'SEARCHING'|'TIMED_OUT',
        'StatusReason': 'string',
        'StatusMessage': 'string',
        'StartTime': datetime(2015, 1, 1),
        'EndTime': datetime(2015, 1, 1),
        'Players': [
            {
                'PlayerId': 'string',
                'PlayerAttributes': {
                    'string': {
                        'S': 'string',
                        'N': 123.0,
                        'SL': [
                            'string',
                        ],
                        'SDM': {
                            'string': 123.0
                        }
                    }
                },
                'Team': 'string',
                'LatencyInMs': {
                    'string': 123
                }
            },
        ],
        'GameSessionConnectionInfo': {
            'GameSessionArn': 'string',
            'IpAddress': 'string',
            'DnsName': 'string',
            'Port': 123,
            'MatchedPlayerSessions': [
                {
                    'PlayerId': 'string',
                    'PlayerSessionId': 'string'
                },
            ]
        },
        'EstimatedWaitTime': 123
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • MatchmakingTicket (dict) --

      Ticket representing the backfill matchmaking request. This object includes the information in the request, ticket status, and match results as generated during the matchmaking process.

      • TicketId (string) --

        A unique identifier for a matchmaking ticket.

      • ConfigurationName (string) --

        Name of the MatchmakingConfiguration that is used with this ticket. Matchmaking configurations determine how players are grouped into a match and how a new game session is created for the match.

      • ConfigurationArn (string) --

        The Amazon Resource Name ( ARN) associated with the GameLift matchmaking configuration resource that is used with this ticket.

      • Status (string) --

        Current status of the matchmaking request.

        • QUEUED -- The matchmaking request has been received and is currently waiting to be processed.

        • SEARCHING -- The matchmaking request is currently being processed.

        • REQUIRES_ACCEPTANCE -- A match has been proposed and the players must accept the match (see AcceptMatch). This status is used only with requests that use a matchmaking configuration with a player acceptance requirement.

        • PLACING -- The FlexMatch engine has matched players and is in the process of placing a new game session for the match.

        • COMPLETED -- Players have been matched and a game session is ready to host the players. A ticket in this state contains the necessary connection information for players.

        • FAILED -- The matchmaking request was not completed.

        • CANCELLED -- The matchmaking request was canceled. This may be the result of a call to StopMatchmaking or a proposed match that one or more players failed to accept.

        • TIMED_OUT -- The matchmaking request was not successful within the duration specified in the matchmaking configuration.

      • StatusReason (string) --

        Code to explain the current status. For example, a status reason may indicate when a ticket has returned to SEARCHING status after a proposed match fails to receive player acceptances.

      • StatusMessage (string) --

        Additional information about the current status.

      • StartTime (datetime) --

        Time stamp indicating when this matchmaking request was received. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • EndTime (datetime) --

        Time stamp indicating when this matchmaking request stopped being processed due to success, failure, or cancellation. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • Players (list) --

        A set of Player objects, each representing a player to find matches for. Players are identified by a unique player ID and may include latency data for use during matchmaking. If the ticket is in status COMPLETED, the Player objects include the team the players were assigned to in the resulting match.

        • (dict) --

          Represents a player in matchmaking. When starting a matchmaking request, a player has a player ID, attributes, and may have latency data. Team information is added after a match has been successfully completed.

          • PlayerId (string) --

            A unique identifier for a player

          • PlayerAttributes (dict) --

            A collection of key:value pairs containing player information for use in matchmaking. Player attribute keys must match the playerAttributes used in a matchmaking rule set. Example: "PlayerAttributes": {"skill": {"N": "23"}, "gameMode": {"S": "deathmatch"}}.

            • (string) --

              • (dict) --

                Values for use in Player attribute key-value pairs. This object lets you specify an attribute value using any of the valid data types: string, number, string array, or data map. Each AttributeValue object can use only one of the available properties.

                • S (string) --

                  For single string values. Maximum string length is 100 characters.

                • N (float) --

                  For number values, expressed as double.

                • SL (list) --

                  For a list of up to 10 strings. Maximum length for each string is 100 characters. Duplicate values are not recognized; all occurrences of the repeated value after the first of a repeated value are ignored.

                  • (string) --

                • SDM (dict) --

                  For a map of up to 10 data type:value pairs. Maximum length for each string value is 100 characters.

                  • (string) --

                    • (float) --

          • Team (string) --

            Name of the team that the player is assigned to in a match. Team names are defined in a matchmaking rule set.

          • LatencyInMs (dict) --

            Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connected to AWS Regions. If this property is present, FlexMatch considers placing the match only in Regions for which latency is reported.

            If a matchmaker has a rule that evaluates player latency, players must report latency in order to be matched. If no latency is reported in this scenario, FlexMatch assumes that no Regions are available to the player and the ticket is not matchable.

            • (string) --

              • (integer) --

      • GameSessionConnectionInfo (dict) --

        Identifier and connection information of the game session created for the match. This information is added to the ticket only after the matchmaking request has been successfully completed.

        • GameSessionArn (string) --

          Amazon Resource Name ( ARN) that is assigned to a game session and uniquely identifies it.

        • IpAddress (string) --

          IP address of the instance that is running the game session. When connecting to a Amazon GameLift game server, a client needs to reference an IP address (or DNS name) and port number.

        • DnsName (string) --

          DNS identifier assigned to the instance that is running the game session. Values have the following format:

          • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.

          • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.)

          When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

        • Port (integer) --

          Port number for the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.

        • MatchedPlayerSessions (list) --

          A collection of player session IDs, one for each player ID that was included in the original matchmaking request.

          • (dict) --

            Represents a new player session that is created as a result of a successful FlexMatch match. A successful match automatically creates new player sessions for every player ID in the original matchmaking request.

            When players connect to the match's game session, they must include both player ID and player session ID in order to claim their assigned player slot.

            • PlayerId (string) --

              A unique identifier for a player

            • PlayerSessionId (string) --

              A unique identifier for a player session

      • EstimatedWaitTime (integer) --

        Average amount of time (in seconds) that players are currently waiting for a match. If there is not enough recent data, this property may be empty.

StartMatchmaking (updated) Link ¶
Changes (response)
{'MatchmakingTicket': {'ConfigurationArn': 'string'}}

Uses FlexMatch to create a game match for a group of players based on custom matchmaking rules, and starts a new game for the matched players. Each matchmaking request specifies the type of match to build (team configuration, rules for an acceptable match, etc.). The request also specifies the players to find a match for and where to host the new game session for optimal performance. A matchmaking request might start with a single player or a group of players who want to play together. FlexMatch finds additional players as needed to fill the match. Match type, rules, and the queue used to place a new game session are defined in a MatchmakingConfiguration.

To start matchmaking, provide a unique ticket ID, specify a matchmaking configuration, and include the players to be matched. You must also include a set of player attributes relevant for the matchmaking configuration. If successful, a matchmaking ticket is returned with status set to QUEUED. Track the status of the ticket to respond as needed and acquire game session connection information for successfully completed matches.

Tracking ticket status -- A couple of options are available for tracking the status of matchmaking requests:

  • Polling -- Call DescribeMatchmaking. This operation returns the full ticket object, including current status and (for completed tickets) game session connection info. We recommend polling no more than once every 10 seconds.

  • Notifications -- Get event notifications for changes in ticket status using Amazon Simple Notification Service (SNS). Notifications are easy to set up (see CreateMatchmakingConfiguration) and typically deliver match status changes faster and more efficiently than polling. We recommend that you use polling to back up to notifications (since delivery is not guaranteed) and call DescribeMatchmaking only when notifications are not received within 30 seconds.

Processing a matchmaking request -- FlexMatch handles a matchmaking request as follows:

  • Your client code submits a StartMatchmaking request for one or more players and tracks the status of the request ticket.

  • FlexMatch uses this ticket and others in process to build an acceptable match. When a potential match is identified, all tickets in the proposed match are advanced to the next status.

  • If the match requires player acceptance (set in the matchmaking configuration), the tickets move into status REQUIRES_ACCEPTANCE. This status triggers your client code to solicit acceptance from all players in every ticket involved in the match, and then call AcceptMatch for each player. If any player rejects or fails to accept the match before a specified timeout, the proposed match is dropped (see AcceptMatch for more details).

  • Once a match is proposed and accepted, the matchmaking tickets move into status PLACING. FlexMatch locates resources for a new game session using the game session queue (set in the matchmaking configuration) and creates the game session based on the match data.

  • When the match is successfully placed, the matchmaking tickets move into COMPLETED status. Connection information (including game session endpoint and player session) is added to the matchmaking tickets. Matched players can use the connection information to join the game.

Learn more

Add FlexMatch to a Game Client

Set Up FlexMatch Event Notification

FlexMatch Integration Roadmap

How GameLift FlexMatch Works

Related operations

  • StartMatchmaking

  • DescribeMatchmaking

  • StopMatchmaking

  • AcceptMatch

  • StartMatchBackfill

See also: AWS API Documentation

Request Syntax

client.start_matchmaking(
    TicketId='string',
    ConfigurationName='string',
    Players=[
        {
            'PlayerId': 'string',
            'PlayerAttributes': {
                'string': {
                    'S': 'string',
                    'N': 123.0,
                    'SL': [
                        'string',
                    ],
                    'SDM': {
                        'string': 123.0
                    }
                }
            },
            'Team': 'string',
            'LatencyInMs': {
                'string': 123
            }
        },
    ]
)
type TicketId:

string

param TicketId:

A unique identifier for a matchmaking ticket. If no ticket ID is specified here, Amazon GameLift will generate one in the form of a UUID. Use this identifier to track the matchmaking ticket status and retrieve match results.

type ConfigurationName:

string

param ConfigurationName:

[REQUIRED]

Name of the matchmaking configuration to use for this request. Matchmaking configurations must exist in the same Region as this request. You can use either the configuration name or ARN value.

type Players:

list

param Players:

[REQUIRED]

Information on each player to be matched. This information must include a player ID, and may contain player attributes and latency data to be used in the matchmaking process. After a successful match, Player objects contain the name of the team the player is assigned to.

  • (dict) --

    Represents a player in matchmaking. When starting a matchmaking request, a player has a player ID, attributes, and may have latency data. Team information is added after a match has been successfully completed.

    • PlayerId (string) --

      A unique identifier for a player

    • PlayerAttributes (dict) --

      A collection of key:value pairs containing player information for use in matchmaking. Player attribute keys must match the playerAttributes used in a matchmaking rule set. Example: "PlayerAttributes": {"skill": {"N": "23"}, "gameMode": {"S": "deathmatch"}}.

      • (string) --

        • (dict) --

          Values for use in Player attribute key-value pairs. This object lets you specify an attribute value using any of the valid data types: string, number, string array, or data map. Each AttributeValue object can use only one of the available properties.

          • S (string) --

            For single string values. Maximum string length is 100 characters.

          • N (float) --

            For number values, expressed as double.

          • SL (list) --

            For a list of up to 10 strings. Maximum length for each string is 100 characters. Duplicate values are not recognized; all occurrences of the repeated value after the first of a repeated value are ignored.

            • (string) --

          • SDM (dict) --

            For a map of up to 10 data type:value pairs. Maximum length for each string value is 100 characters.

            • (string) --

              • (float) --

    • Team (string) --

      Name of the team that the player is assigned to in a match. Team names are defined in a matchmaking rule set.

    • LatencyInMs (dict) --

      Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connected to AWS Regions. If this property is present, FlexMatch considers placing the match only in Regions for which latency is reported.

      If a matchmaker has a rule that evaluates player latency, players must report latency in order to be matched. If no latency is reported in this scenario, FlexMatch assumes that no Regions are available to the player and the ticket is not matchable.

      • (string) --

        • (integer) --

rtype:

dict

returns:

Response Syntax

{
    'MatchmakingTicket': {
        'TicketId': 'string',
        'ConfigurationName': 'string',
        'ConfigurationArn': 'string',
        'Status': 'CANCELLED'|'COMPLETED'|'FAILED'|'PLACING'|'QUEUED'|'REQUIRES_ACCEPTANCE'|'SEARCHING'|'TIMED_OUT',
        'StatusReason': 'string',
        'StatusMessage': 'string',
        'StartTime': datetime(2015, 1, 1),
        'EndTime': datetime(2015, 1, 1),
        'Players': [
            {
                'PlayerId': 'string',
                'PlayerAttributes': {
                    'string': {
                        'S': 'string',
                        'N': 123.0,
                        'SL': [
                            'string',
                        ],
                        'SDM': {
                            'string': 123.0
                        }
                    }
                },
                'Team': 'string',
                'LatencyInMs': {
                    'string': 123
                }
            },
        ],
        'GameSessionConnectionInfo': {
            'GameSessionArn': 'string',
            'IpAddress': 'string',
            'DnsName': 'string',
            'Port': 123,
            'MatchedPlayerSessions': [
                {
                    'PlayerId': 'string',
                    'PlayerSessionId': 'string'
                },
            ]
        },
        'EstimatedWaitTime': 123
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • MatchmakingTicket (dict) --

      Ticket representing the matchmaking request. This object include the information included in the request, ticket status, and match results as generated during the matchmaking process.

      • TicketId (string) --

        A unique identifier for a matchmaking ticket.

      • ConfigurationName (string) --

        Name of the MatchmakingConfiguration that is used with this ticket. Matchmaking configurations determine how players are grouped into a match and how a new game session is created for the match.

      • ConfigurationArn (string) --

        The Amazon Resource Name ( ARN) associated with the GameLift matchmaking configuration resource that is used with this ticket.

      • Status (string) --

        Current status of the matchmaking request.

        • QUEUED -- The matchmaking request has been received and is currently waiting to be processed.

        • SEARCHING -- The matchmaking request is currently being processed.

        • REQUIRES_ACCEPTANCE -- A match has been proposed and the players must accept the match (see AcceptMatch). This status is used only with requests that use a matchmaking configuration with a player acceptance requirement.

        • PLACING -- The FlexMatch engine has matched players and is in the process of placing a new game session for the match.

        • COMPLETED -- Players have been matched and a game session is ready to host the players. A ticket in this state contains the necessary connection information for players.

        • FAILED -- The matchmaking request was not completed.

        • CANCELLED -- The matchmaking request was canceled. This may be the result of a call to StopMatchmaking or a proposed match that one or more players failed to accept.

        • TIMED_OUT -- The matchmaking request was not successful within the duration specified in the matchmaking configuration.

      • StatusReason (string) --

        Code to explain the current status. For example, a status reason may indicate when a ticket has returned to SEARCHING status after a proposed match fails to receive player acceptances.

      • StatusMessage (string) --

        Additional information about the current status.

      • StartTime (datetime) --

        Time stamp indicating when this matchmaking request was received. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • EndTime (datetime) --

        Time stamp indicating when this matchmaking request stopped being processed due to success, failure, or cancellation. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • Players (list) --

        A set of Player objects, each representing a player to find matches for. Players are identified by a unique player ID and may include latency data for use during matchmaking. If the ticket is in status COMPLETED, the Player objects include the team the players were assigned to in the resulting match.

        • (dict) --

          Represents a player in matchmaking. When starting a matchmaking request, a player has a player ID, attributes, and may have latency data. Team information is added after a match has been successfully completed.

          • PlayerId (string) --

            A unique identifier for a player

          • PlayerAttributes (dict) --

            A collection of key:value pairs containing player information for use in matchmaking. Player attribute keys must match the playerAttributes used in a matchmaking rule set. Example: "PlayerAttributes": {"skill": {"N": "23"}, "gameMode": {"S": "deathmatch"}}.

            • (string) --

              • (dict) --

                Values for use in Player attribute key-value pairs. This object lets you specify an attribute value using any of the valid data types: string, number, string array, or data map. Each AttributeValue object can use only one of the available properties.

                • S (string) --

                  For single string values. Maximum string length is 100 characters.

                • N (float) --

                  For number values, expressed as double.

                • SL (list) --

                  For a list of up to 10 strings. Maximum length for each string is 100 characters. Duplicate values are not recognized; all occurrences of the repeated value after the first of a repeated value are ignored.

                  • (string) --

                • SDM (dict) --

                  For a map of up to 10 data type:value pairs. Maximum length for each string value is 100 characters.

                  • (string) --

                    • (float) --

          • Team (string) --

            Name of the team that the player is assigned to in a match. Team names are defined in a matchmaking rule set.

          • LatencyInMs (dict) --

            Set of values, expressed in milliseconds, indicating the amount of latency that a player experiences when connected to AWS Regions. If this property is present, FlexMatch considers placing the match only in Regions for which latency is reported.

            If a matchmaker has a rule that evaluates player latency, players must report latency in order to be matched. If no latency is reported in this scenario, FlexMatch assumes that no Regions are available to the player and the ticket is not matchable.

            • (string) --

              • (integer) --

      • GameSessionConnectionInfo (dict) --

        Identifier and connection information of the game session created for the match. This information is added to the ticket only after the matchmaking request has been successfully completed.

        • GameSessionArn (string) --

          Amazon Resource Name ( ARN) that is assigned to a game session and uniquely identifies it.

        • IpAddress (string) --

          IP address of the instance that is running the game session. When connecting to a Amazon GameLift game server, a client needs to reference an IP address (or DNS name) and port number.

        • DnsName (string) --

          DNS identifier assigned to the instance that is running the game session. Values have the following format:

          • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.

          • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.)

          When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

        • Port (integer) --

          Port number for the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.

        • MatchedPlayerSessions (list) --

          A collection of player session IDs, one for each player ID that was included in the original matchmaking request.

          • (dict) --

            Represents a new player session that is created as a result of a successful FlexMatch match. A successful match automatically creates new player sessions for every player ID in the original matchmaking request.

            When players connect to the match's game session, they must include both player ID and player session ID in order to claim their assigned player slot.

            • PlayerId (string) --

              A unique identifier for a player

            • PlayerSessionId (string) --

              A unique identifier for a player session

      • EstimatedWaitTime (integer) --

        Average amount of time (in seconds) that players are currently waiting for a match. If there is not enough recent data, this property may be empty.

UpdateBuild (updated) Link ¶
Changes (response)
{'Build': {'BuildArn': 'string'}}

Updates metadata in a build record, including the build name and version. To update the metadata, specify the build ID to update and provide the new values. If successful, a build object containing the updated metadata is returned.

Learn more

Working with Builds

Related operations

  • CreateBuild

  • ListBuilds

  • DescribeBuild

  • UpdateBuild

  • DeleteBuild

See also: AWS API Documentation

Request Syntax

client.update_build(
    BuildId='string',
    Name='string',
    Version='string'
)
type BuildId:

string

param BuildId:

[REQUIRED]

A unique identifier for a build to update. You can use either the build ID or ARN value.

type Name:

string

param Name:

A descriptive label that is associated with a build. Build names do not need to be unique.

type Version:

string

param Version:

Version information that is associated with a build or script. Version strings do not need to be unique.

rtype:

dict

returns:

Response Syntax

{
    'Build': {
        'BuildId': 'string',
        'BuildArn': 'string',
        'Name': 'string',
        'Version': 'string',
        'Status': 'INITIALIZED'|'READY'|'FAILED',
        'SizeOnDisk': 123,
        'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX'|'AMAZON_LINUX_2',
        'CreationTime': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • Build (dict) --

      The updated build record.

      • BuildId (string) --

        A unique identifier for a build.

      • BuildArn (string) --

        Amazon Resource Name ( ARN) that is assigned to a GameLift build resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift build ARN, the resource ID matches the BuildId value.

      • Name (string) --

        A descriptive label that is associated with a build. Build names do not need to be unique. It can be set using CreateBuild or UpdateBuild.

      • Version (string) --

        Version information that is associated with a build or script. Version strings do not need to be unique. This value can be set using CreateBuild or UpdateBuild.

      • Status (string) --

        Current status of the build.

        Possible build statuses include the following:

        • INITIALIZED -- A new build has been defined, but no files have been uploaded. You cannot create fleets for builds that are in this status. When a build is successfully created, the build status is set to this value.

        • READY -- The game build has been successfully uploaded. You can now create new fleets for this build.

        • FAILED -- The game build upload failed. You cannot create new fleets for this build.

      • SizeOnDisk (integer) --

        File size of the uploaded game build, expressed in bytes. When the build status is INITIALIZED, this value is 0.

      • OperatingSystem (string) --

        Operating system that the game server binaries are built to run on. This value determines the type of fleet resources that you can use for this build.

      • 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").

UpdateGameSession (updated) Link ¶
Changes (response)
{'GameSession': {'FleetArn': 'string'}}

Updates game session properties. This includes the session name, maximum player count, protection policy, which controls whether or not an active game session can be terminated during a scale-down event, and the player session creation policy, which controls whether or not new players can join the session. To update a game session, specify the game session ID and the values you want to change. If successful, an updated GameSession object is returned.

  • CreateGameSession

  • DescribeGameSessions

  • DescribeGameSessionDetails

  • SearchGameSessions

  • UpdateGameSession

  • GetGameSessionLogUrl

  • Game session placements

    • StartGameSessionPlacement

    • DescribeGameSessionPlacement

    • StopGameSessionPlacement

See also: AWS API Documentation

Request Syntax

client.update_game_session(
    GameSessionId='string',
    MaximumPlayerSessionCount=123,
    Name='string',
    PlayerSessionCreationPolicy='ACCEPT_ALL'|'DENY_ALL',
    ProtectionPolicy='NoProtection'|'FullProtection'
)
type GameSessionId:

string

param GameSessionId:

[REQUIRED]

A unique identifier for the game session to update.

type MaximumPlayerSessionCount:

integer

param MaximumPlayerSessionCount:

The maximum number of players that can be connected simultaneously to the game session.

type Name:

string

param Name:

A descriptive label that is associated with a game session. Session names do not need to be unique.

type PlayerSessionCreationPolicy:

string

param PlayerSessionCreationPolicy:

Policy determining whether or not the game session accepts new players.

type ProtectionPolicy:

string

param ProtectionPolicy:

Game session protection policy to apply to this game session only.

  • 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.

rtype:

dict

returns:

Response Syntax

{
    'GameSession': {
        'GameSessionId': 'string',
        'Name': 'string',
        'FleetId': 'string',
        'FleetArn': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'TerminationTime': datetime(2015, 1, 1),
        'CurrentPlayerSessionCount': 123,
        'MaximumPlayerSessionCount': 123,
        'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR',
        'StatusReason': 'INTERRUPTED',
        'GameProperties': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'IpAddress': 'string',
        'DnsName': 'string',
        'Port': 123,
        'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL',
        'CreatorId': 'string',
        'GameSessionData': 'string',
        'MatchmakerData': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • GameSession (dict) --

      The updated game session metadata.

      • GameSessionId (string) --

        A unique identifier for the game session. A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token>.

      • Name (string) --

        A descriptive label that is associated with a game session. Session names do not need to be unique.

      • FleetId (string) --

        A unique identifier for a fleet that the game session is running on.

      • FleetArn (string) --

        The Amazon Resource Name ( ARN) associated with the GameLift fleet that this game session is running on.

      • 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").

      • CurrentPlayerSessionCount (integer) --

        Number of players currently in the game session.

      • MaximumPlayerSessionCount (integer) --

        The maximum number of players that can be connected simultaneously to the game session.

      • Status (string) --

        Current status of the game session. A game session must have an ACTIVE status to have player sessions.

      • StatusReason (string) --

        Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.

      • GameProperties (list) --

        Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). You can search for active game sessions based on this custom data with SearchGameSessions.

        • (dict) --

          Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session. For example, a game property might specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session. For more information, see the Amazon GameLift Developer Guide.

          • Key (string) --

            The game property identifier.

          • Value (string) --

            The game property value.

      • IpAddress (string) --

        IP address of the instance that is running the game session. When connecting to a Amazon GameLift game server, a client needs to reference an IP address (or DNS name) and port number.

      • DnsName (string) --

        DNS identifier assigned to the instance that is running the game session. Values have the following format:

        • TLS-enabled fleets: <unique identifier>.<region identifier>.amazongamelift.com.

        • Non-TLS-enabled fleets: ec2-<unique identifier>.compute.amazonaws.com. (See Amazon EC2 Instance IP Addressing.)

        When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.

      • Port (integer) --

        Port number for the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.

      • PlayerSessionCreationPolicy (string) --

        Indicates whether or not the game session is accepting new players.

      • CreatorId (string) --

        A unique identifier for a player. This ID is used to enforce a resource protection policy (if one exists), that limits the number of game sessions a player can create.

      • GameSessionData (string) --

        Set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session).

      • MatchmakerData (string) --

        Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formatted as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data. Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill).

UpdateMatchmakingConfiguration (updated) Link ¶
Changes (response)
{'Configuration': {'ConfigurationArn': 'string', 'RuleSetArn': 'string'}}

Updates settings for a FlexMatch matchmaking configuration. These changes affect all matches and game sessions that are created after the update. To update settings, specify the configuration name to be updated and provide the new settings.

Learn more

Design a FlexMatch Matchmaker

Related operations

  • CreateMatchmakingConfiguration

  • DescribeMatchmakingConfigurations

  • UpdateMatchmakingConfiguration

  • DeleteMatchmakingConfiguration

  • CreateMatchmakingRuleSet

  • DescribeMatchmakingRuleSets

  • ValidateMatchmakingRuleSet

  • DeleteMatchmakingRuleSet

See also: AWS API Documentation

Request Syntax

client.update_matchmaking_configuration(
    Name='string',
    Description='string',
    GameSessionQueueArns=[
        'string',
    ],
    RequestTimeoutSeconds=123,
    AcceptanceTimeoutSeconds=123,
    AcceptanceRequired=True|False,
    RuleSetName='string',
    NotificationTarget='string',
    AdditionalPlayerCount=123,
    CustomEventData='string',
    GameProperties=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    GameSessionData='string',
    BackfillMode='AUTOMATIC'|'MANUAL'
)
type Name:

string

param Name:

[REQUIRED]

A unique identifier for a matchmaking configuration to update. You can use either the configuration name or ARN value.

type Description:

string

param Description:

A descriptive label that is associated with matchmaking configuration.

type GameSessionQueueArns:

list

param GameSessionQueueArns:

Amazon Resource Name ( ARN) that is assigned to a GameLift game session queue resource and uniquely identifies it. ARNs are unique across all Regions. These queues are used when placing game sessions for matches that are created with this matchmaking configuration. Queues can be located in any Region.

  • (string) --

type RequestTimeoutSeconds:

integer

param RequestTimeoutSeconds:

The maximum duration, in seconds, that a matchmaking ticket can remain in process before timing out. Requests that fail due to timing out can be resubmitted as needed.

type AcceptanceTimeoutSeconds:

integer

param AcceptanceTimeoutSeconds:

The length of time (in seconds) to wait for players to accept a proposed match. If any player rejects the match or fails to accept before the timeout, the ticket continues to look for an acceptable match.

type AcceptanceRequired:

boolean

param AcceptanceRequired:

A flag that indicates whether a match that was created with this configuration must be accepted by the matched players. To require acceptance, set to TRUE.

type RuleSetName:

string

param RuleSetName:

A unique identifier for a matchmaking rule set to use with this configuration. You can use either the rule set name or ARN value. A matchmaking configuration can only use rule sets that are defined in the same Region.

type NotificationTarget:

string

param NotificationTarget:

An SNS topic ARN that is set up to receive matchmaking notifications. See Setting up Notifications for Matchmaking for more information.

type AdditionalPlayerCount:

integer

param AdditionalPlayerCount:

The number of player slots in a match to keep open for future players. For example, assume that the configuration's rule set specifies a match for a single 12-person team. If the additional player count is set to 2, only 10 players are initially selected for the match.

type CustomEventData:

string

param CustomEventData:

Information to add to all events related to the matchmaking configuration.

type GameProperties:

list

param GameProperties:

A set of custom properties for a game session, formatted as key-value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). This information is added to the new GameSession object that is created for a successful match.

  • (dict) --

    Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session. For example, a game property might specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session. For more information, see the Amazon GameLift Developer Guide.

    • Key (string) -- [REQUIRED]

      The game property identifier.

    • Value (string) -- [REQUIRED]

      The game property value.

type GameSessionData:

string

param GameSessionData:

A set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). This information is added to the new GameSession object that is created for a successful match.

type BackfillMode:

string

param BackfillMode:

The method that is used to backfill game sessions created with this matchmaking configuration. Specify MANUAL when your game manages backfill requests manually or does not use the match backfill feature. Specify AUTOMATIC to have GameLift create a StartMatchBackfill request whenever a game session has one or more open slots. Learn more about manual and automatic backfill in Backfill Existing Games with FlexMatch.

rtype:

dict

returns:

Response Syntax

{
    'Configuration': {
        'Name': 'string',
        'ConfigurationArn': 'string',
        'Description': 'string',
        'GameSessionQueueArns': [
            'string',
        ],
        'RequestTimeoutSeconds': 123,
        'AcceptanceTimeoutSeconds': 123,
        'AcceptanceRequired': True|False,
        'RuleSetName': 'string',
        'RuleSetArn': 'string',
        'NotificationTarget': 'string',
        'AdditionalPlayerCount': 123,
        'CustomEventData': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'GameProperties': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'GameSessionData': 'string',
        'BackfillMode': 'AUTOMATIC'|'MANUAL'
    }
}

Response Structure

  • (dict) --

    Represents the returned data in response to a request action.

    • Configuration (dict) --

      The updated matchmaking configuration.

      • Name (string) --

        A unique identifier for a matchmaking configuration. This name is used to identify the configuration associated with a matchmaking request or ticket.

      • ConfigurationArn (string) --

        Amazon Resource Name ( ARN) that is assigned to a GameLift matchmaking configuration resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift configuration ARN, the resource ID matches the Name value.

      • Description (string) --

        A descriptive label that is associated with matchmaking configuration.

      • GameSessionQueueArns (list) --

        Amazon Resource Name ( ARN) that is assigned to a GameLift game session queue resource and uniquely identifies it. ARNs are unique across all Regions. GameLift uses the listed queues when placing game sessions for matches that are created with this matchmaking configuration. Queues can be located in any Region.

        • (string) --

      • RequestTimeoutSeconds (integer) --

        The maximum duration, in seconds, that a matchmaking ticket can remain in process before timing out. Requests that fail due to timing out can be resubmitted as needed.

      • AcceptanceTimeoutSeconds (integer) --

        The length of time (in seconds) to wait for players to accept a proposed match. If any player rejects the match or fails to accept before the timeout, the ticket continues to look for an acceptable match.

      • AcceptanceRequired (boolean) --

        A flag that indicates whether a match that was created with this configuration must be accepted by the matched players. To require acceptance, set to TRUE.

      • RuleSetName (string) --

        A unique identifier for a matchmaking rule set to use with this configuration. A matchmaking configuration can only use rule sets that are defined in the same Region.

      • RuleSetArn (string) --

        The Amazon Resource Name ( ARN) associated with the GameLift matchmaking rule set resource that this configuration uses.

      • NotificationTarget (string) --

        An SNS topic ARN that is set up to receive matchmaking notifications.

      • AdditionalPlayerCount (integer) --

        The number of player slots in a match to keep open for future players. For example, assume that the configuration's rule set specifies a match for a single 12-person team. If the additional player count is set to 2, only 10 players are initially selected for the match.

      • CustomEventData (string) --

        Information to attach to all events related to the matchmaking configuration.

      • CreationTime (datetime) --

        The time stamp indicating when this data object was created. The format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • GameProperties (list) --

        A set of custom properties for a game session, formatted as key-value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). This information is added to the new GameSession object that is created for a successful match.

        • (dict) --

          Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session. For example, a game property might specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session. For more information, see the Amazon GameLift Developer Guide.

          • Key (string) --

            The game property identifier.

          • Value (string) --

            The game property value.

      • GameSessionData (string) --

        A set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session). This information is added to the new GameSession object that is created for a successful match.

      • BackfillMode (string) --

        The method used to backfill game sessions created with this matchmaking configuration. MANUAL indicates that the game makes backfill requests or does not use the match backfill feature. AUTOMATIC indicates that GameLift creates StartMatchBackfill requests whenever a game session has one or more open slots. Learn more about manual and automatic backfill in Backfill Existing Games with FlexMatch.

UpdateScript (updated) Link ¶
Changes (response)
{'Script': {'ScriptArn': 'string'}}

Updates Realtime script metadata and content.

To update script metadata, specify the script ID and provide updated name and/or version values.

To update script content, provide an updated zip file by pointing to either a local file or an Amazon S3 bucket location. You can use either method regardless of how the original script was uploaded. Use the Version parameter to track updates to the script.

If the call is successful, the updated metadata is stored in the script record and a revised script is uploaded to the Amazon GameLift service. Once the script is updated and acquired by a fleet instance, the new version is used for all new game sessions.

Learn more

Amazon GameLift Realtime Servers

Related operations

  • CreateScript

  • ListScripts

  • DescribeScript

  • UpdateScript

  • DeleteScript

See also: AWS API Documentation

Request Syntax

client.update_script(
    ScriptId='string',
    Name='string',
    Version='string',
    StorageLocation={
        'Bucket': 'string',
        'Key': 'string',
        'RoleArn': 'string',
        'ObjectVersion': 'string'
    },
    ZipFile=b'bytes'
)
type ScriptId:

string

param ScriptId:

[REQUIRED]

A unique identifier for a Realtime script to update. You can use either the script ID or ARN value.

type Name:

string

param Name:

A descriptive label that is associated with a script. Script names do not need to be unique.

type Version:

string

param Version:

The version that is associated with a build or script. Version strings do not need to be unique.

type StorageLocation:

dict

param StorageLocation:

The location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon GameLift to access the Amazon S3 storage location. The S3 bucket must be in the same Region where you want to create a new script. By default, Amazon GameLift uploads the latest version of the zip file; if you have S3 object versioning turned on, you can use the ObjectVersion parameter to specify an earlier version.

  • Bucket (string) --

    An Amazon S3 bucket identifier. This is the name of the S3 bucket.

  • Key (string) --

    The name of the zip file that contains the build files or script files.

  • RoleArn (string) --

    The Amazon Resource Name ( ARN) for an IAM role that allows Amazon GameLift to access the S3 bucket.

  • ObjectVersion (string) --

    The version of the file, if object versioning is turned on for the bucket. Amazon GameLift uses this information when retrieving files from an S3 bucket that you own. Use this parameter to specify a specific version of the file. If not set, the latest version of the file is retrieved.

type ZipFile:

bytes

param ZipFile:

A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.

When using the AWS CLI tool to create a script, this parameter is set to the zip file name. It must be prepended with the string "fileb://" to indicate that the file data is a binary object. For example: --zip-file fileb://myRealtimeScript.zip.

rtype:

dict

returns:

Response Syntax

{
    'Script': {
        'ScriptId': 'string',
        'ScriptArn': 'string',
        'Name': 'string',
        'Version': 'string',
        'SizeOnDisk': 123,
        'CreationTime': datetime(2015, 1, 1),
        'StorageLocation': {
            'Bucket': 'string',
            'Key': 'string',
            'RoleArn': 'string',
            'ObjectVersion': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • Script (dict) --

      The newly created script record with a unique script ID. The new script's storage location reflects an Amazon S3 location: (1) If the script was uploaded from an S3 bucket under your account, the storage location reflects the information that was provided in the CreateScript request; (2) If the script file was uploaded from a local zip file, the storage location reflects an S3 location controls by the Amazon GameLift service.

      • ScriptId (string) --

        A unique identifier for a Realtime script

      • ScriptArn (string) --

        Amazon Resource Name ( ARN) that is assigned to a GameLift script resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift script ARN, the resource ID matches the ScriptId value.

      • Name (string) --

        A descriptive label that is associated with a script. Script names do not need to be unique.

      • Version (string) --

        The version that is associated with a build or script. Version strings do not need to be unique.

      • SizeOnDisk (integer) --

        The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 location, this value remains at "0".

      • CreationTime (datetime) --

        A time stamp indicating when this data object was created. The format is a number expressed in Unix time as milliseconds (for example "1469498468.057").

      • StorageLocation (dict) --

        The location in Amazon S3 where build or script files are stored for access by Amazon GameLift. This location is specified in CreateBuild, CreateScript, and UpdateScript requests.

        • Bucket (string) --

          An Amazon S3 bucket identifier. This is the name of the S3 bucket.

        • Key (string) --

          The name of the zip file that contains the build files or script files.

        • RoleArn (string) --

          The Amazon Resource Name ( ARN) for an IAM role that allows Amazon GameLift to access the S3 bucket.

        • ObjectVersion (string) --

          The version of the file, if object versioning is turned on for the bucket. Amazon GameLift uses this information when retrieving files from an S3 bucket that you own. Use this parameter to specify a specific version of the file. If not set, the latest version of the file is retrieved.