amazonka-gamelift-2.0: Amazon GameLift SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

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 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 Amazon GameLift Local.

Learn more

Start a game session

All APIs by task

Synopsis

Creating a Request

data CreateGameSession Source #

See: newCreateGameSession smart constructor.

Constructors

CreateGameSession' 

Fields

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

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

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

  • 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 with a request to start a new game session (see Start a Game Session).

  • 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 with a request to start a new game session (see Start a Game Session).

  • gameSessionId :: Maybe Text

    This parameter is deprecated. 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.

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

  • 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 Amazon Web Services Region code such as us-west-2.

  • name :: Maybe Text

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

  • maximumPlayerSessionCount :: Natural

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

Instances

Instances details
ToJSON CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.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

AWSRequest CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Associated Types

type AWSResponse CreateGameSession #

Generic CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Associated Types

type Rep CreateGameSession :: Type -> Type #

Read CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Show CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

NFData CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Methods

rnf :: CreateGameSession -> () #

Eq CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Hashable CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

type AWSResponse CreateGameSession Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

type Rep 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:

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.

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.

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.

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 with a request to start a new game session (see Start a Game Session).

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 with a request to start a new game session (see Start a Game Session).

CreateGameSession, createGameSession_gameSessionId - This parameter is deprecated. 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: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.

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 Amazon Web Services Region code such as us-west-2.

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

CreateGameSession, createGameSession_maximumPlayerSessionCount - The maximum number of players that can be connected simultaneously to the game session.

Request Lenses

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_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_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_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 with a request to start a new game session (see Start a Game Session).

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 with a request to start a new game session (see Start a Game Session).

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

This parameter is deprecated. 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_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_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 Amazon Web Services Region code such as us-west-2.

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_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 #

See: newCreateGameSessionResponse smart constructor.

Constructors

CreateGameSessionResponse' 

Fields

Instances

Instances details
Generic CreateGameSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Associated Types

type Rep CreateGameSessionResponse :: Type -> Type #

Read CreateGameSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Show CreateGameSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

NFData CreateGameSessionResponse Source # 
Instance details

Defined in Amazonka.GameLift.CreateGameSession

Eq 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" "amazonka-gamelift-2.0-IjhNQby9jLV6gj30IrgsyK" '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:

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.