libZSservicesZSamazonka-gameliftZSamazonka-gamelift
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.GameLift.CreateGameSession

Description

Creates a multiplayer game session for players in a specific fleet location. This operation prompts an available server process to start a game session and retrieves connection information for the new game session. As an alternative, consider using the GameLift game session placement feature with

with StartGameSessionPlacement, which uses FleetIQ algorithms and queues to optimize the placement process.

When creating a game session, you specify exactly where you want to place it and provide a set of game session configuration settings. The fleet must be in ACTIVE status before a game session can be created in it.

This operation can be used in the following ways:

  • To create a game session on an instance in a fleet's home Region, provide a fleet or alias ID along with your game session configuration.
  • To create a game session on an instance in a fleet's remote location, provide a fleet or alias ID and a location name, along with your game session configuration.

If successful, a workflow is initiated to start a new game session. A GameSession object is returned containing the game session configuration and status. When the status is ACTIVE, game session connection information is provided and player sessions can be created for the game session. 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 are retained for all active game sessions for 14 days. To access the logs, call GetGameSessionLogUrl to download the log files.

Available in GameLift Local.

Learn more

Start a game session

Related actions

CreateGameSession | DescribeGameSessions | DescribeGameSessionDetails | SearchGameSessions | UpdateGameSession | GetGameSessionLogUrl | StartGameSessionPlacement | DescribeGameSessionPlacement | StopGameSessionPlacement | All APIs by task

Synopsis

Creating a Request

data CreateGameSession Source #

Represents the input for a request operation.

See: newCreateGameSession smart constructor.

Constructors

CreateGameSession' 

Fields

  • idempotencyToken :: Maybe Text

    Custom string that uniquely identifies the new game session request. This is useful for ensuring that game session requests with the same idempotency token are processed only once. Subsequent requests with the same string return the original GameSession object, with an updated status. 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.

  • gameProperties :: Maybe [GameProperty]

    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.

  • location :: Maybe Text

    A fleet's remote location to place the new game session in. If this parameter is not set, the new game session is placed in the fleet's home Region. Specify a remote location with an AWS Region code such as us-west-2.

  • gameSessionId :: Maybe Text

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

  • aliasId :: Maybe Text

    A unique identifier for the 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.

  • name :: Maybe Text

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

  • gameSessionData :: Maybe Text

    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.

  • fleetId :: Maybe Text

    A unique identifier for the 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.

  • creatorId :: Maybe Text

    A unique identifier for a player or entity creating the game session. This parameter is required when requesting a new game session on a fleet with a resource creation limit policy. This type of policy limits the number of concurrent active game sessions that one player can create within a certain time span. GameLift uses the CreatorId to evaluate the new request against the policy.

  • maximumPlayerSessionCount :: Natural

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

Instances

Instances details
Eq CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Read CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Show CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Generic CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Associated Types

type Rep CreateGameSession :: Type -> Type #

NFData CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Methods

rnf :: CreateGameSession -> () #

Hashable CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

ToJSON CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

AWSRequest CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Associated Types

type AWSResponse CreateGameSession #

ToHeaders CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

ToPath CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

ToQuery CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

type Rep CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

type AWSResponse CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

newCreateGameSession Source #

Create a value of CreateGameSession with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:idempotencyToken:CreateGameSession', createGameSession_idempotencyToken - Custom string that uniquely identifies the new game session request. This is useful for ensuring that game session requests with the same idempotency token are processed only once. Subsequent requests with the same string return the original GameSession object, with an updated status. 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.

$sel:gameProperties:CreateGameSession', createGameSession_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.

$sel:location:CreateGameSession', createGameSession_location - A fleet's remote location to place the new game session in. If this parameter is not set, the new game session is placed in the fleet's home Region. Specify a remote location with an AWS Region code such as us-west-2.

$sel:gameSessionId:CreateGameSession', createGameSession_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.

$sel:aliasId:CreateGameSession', createGameSession_aliasId - A unique identifier for the 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.

$sel:name:CreateGameSession', createGameSession_name - A descriptive label that is associated with a game session. Session names do not need to be unique.

$sel:gameSessionData:CreateGameSession', createGameSession_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.

$sel:fleetId:CreateGameSession', createGameSession_fleetId - A unique identifier for the 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.

$sel:creatorId:CreateGameSession', createGameSession_creatorId - A unique identifier for a player or entity creating the game session. This parameter is required when requesting a new game session on a fleet with a resource creation limit policy. This type of policy limits the number of concurrent active game sessions that one player can create within a certain time span. GameLift uses the CreatorId to evaluate the new request against the policy.

$sel:maximumPlayerSessionCount:CreateGameSession', createGameSession_maximumPlayerSessionCount - The maximum number of players that can be connected simultaneously to the game session.

Request Lenses

createGameSession_idempotencyToken :: Lens' CreateGameSession (Maybe Text) Source #

Custom string that uniquely identifies the new game session request. This is useful for ensuring that game session requests with the same idempotency token are processed only once. Subsequent requests with the same string return the original GameSession object, with an updated status. 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.

createGameSession_gameProperties :: Lens' CreateGameSession (Maybe [GameProperty]) Source #

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.

createGameSession_location :: Lens' CreateGameSession (Maybe Text) Source #

A fleet's remote location to place the new game session in. If this parameter is not set, the new game session is placed in the fleet's home Region. Specify a remote location with an AWS Region code such as us-west-2.

createGameSession_gameSessionId :: Lens' CreateGameSession (Maybe Text) Source #

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

createGameSession_aliasId :: Lens' CreateGameSession (Maybe Text) Source #

A unique identifier for the 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.

createGameSession_name :: Lens' CreateGameSession (Maybe Text) Source #

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

createGameSession_gameSessionData :: Lens' CreateGameSession (Maybe Text) Source #

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.

createGameSession_fleetId :: Lens' CreateGameSession (Maybe Text) Source #

A unique identifier for the 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.

createGameSession_creatorId :: Lens' CreateGameSession (Maybe Text) Source #

A unique identifier for a player or entity creating the game session. This parameter is required when requesting a new game session on a fleet with a resource creation limit policy. This type of policy limits the number of concurrent active game sessions that one player can create within a certain time span. GameLift uses the CreatorId to evaluate the new request against the policy.

createGameSession_maximumPlayerSessionCount :: Lens' CreateGameSession Natural Source #

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

Destructuring the Response

data CreateGameSessionResponse Source #

Represents the returned data in response to a request operation.

See: newCreateGameSessionResponse smart constructor.

Constructors

CreateGameSessionResponse' 

Fields

Instances

Instances details
Eq CreateGameSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Read CreateGameSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Show CreateGameSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Generic CreateGameSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Associated Types

type Rep CreateGameSessionResponse :: Type -> Type #

NFData CreateGameSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

type Rep CreateGameSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

type Rep CreateGameSessionResponse = D1 ('MetaData "CreateGameSessionResponse" "Amazonka.GameLift.CreateGameSession" "libZSservicesZSamazonka-gameliftZSamazonka-gamelift" 'False) (C1 ('MetaCons "CreateGameSessionResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "gameSession") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe GameSession)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newCreateGameSessionResponse Source #

Create a value of CreateGameSessionResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:gameSession:CreateGameSessionResponse', createGameSessionResponse_gameSession - Object that describes the newly created game session record.

$sel:httpStatus:CreateGameSessionResponse', createGameSessionResponse_httpStatus - The response's http status code.

Response Lenses

createGameSessionResponse_gameSession :: Lens' CreateGameSessionResponse (Maybe GameSession) Source #

Object that describes the newly created game session record.