This article describes how to integrate brainCloud into an existing AWS GameLift application. Once configured, brainCloud's lobby and matchmaking services will orchestrate player sessions on your existing GameLift fleet — with minimal changes required to your client and server code. The only client-visible difference is that the connect information returned after matchmaking will specify a protocol type of gamelift.
GameLift support was first introduced in brainCloud 4.9, with Relay Server support added in 4.13 and EventBridge support in 5.7.
Overview
brainCloud's GameLift integration is particularly well-suited to games that already have servers running in GameLift, need the performance boost of GameLift's non-containerized architecture, or seek to reduce hosting costs via AWS Spot Instances.
The integration supports both Room Servers (introduced in 4.9) and Relay Servers (introduced in 4.13). In both cases, brainCloud handles the lobby, matchmaking, and player session management — and delegates server launching to your GameLift fleet.
Pricing note: GameLift hosting is priced differently from standard brainCloud-hosted servers. brainCloud charges the equivalent of 5 API Calls per player added to your GameLift servers. This is separate from any costs that AWS GameLift charges you directly.
Prerequisites
Before beginning configuration, ensure you have the following in place:
An active AWS account with GameLift enabled
A GameLift fleet (or fleets) created and running your game server build
A GameLift game session queue configured to route requests to your fleet(s)
AWS IAM credentials (Access Key ID and Secret Access Key) with permissions to call
gamelift:CreatePlayerSessionand related APIs
A brainCloud app with RTT (Real-Time Tech) and Lobbies enabled
Step 1 — Enable the GameLift Integration in brainCloud
Navigate to App > Design > Integrations > Manage Integrations in the brainCloud Design Portal. You will find a dedicated AWS GameLift Integration section. Enter your AWS credentials and the target region(s) for your fleet. Save the configuration.
Step 2 — Configure a GameLift Room Server (or Relay Server)
Navigate to App > Design > Cloud Code > My Servers. Add a new server
and select the GameLift Room Server type (or GameLift Relay Server if you are using Relay Server architecture).
Configure the following for the server entry:
GameLift Queue Name — the name of the GameLift game session queue that brainCloud will use to place player sessions
Secret — a shared secret used to authenticate calls from brainCloud to your game server
Region list — the regions you want to make available for this server configuration (these must align with your GameLift fleet regions)
Step 3 — Configure Your Lobby
Navigate to App > Design > Multiplayer > Lobbies and edit the relevant lobby type. In the lobby rules, set the Server field to point to the GameLift server configuration you created in Step 2.
For a full overview of lobby configuration options and states, refer to the brainCloud Lobby API documentation.
Step 4 — Update Your Game Server
Your game server running inside GameLift needs to notify brainCloud at two key points in the session lifecycle, using the following Lobby service S2S calls:
Session start: Call Lobby.SysRoomReady( lobbyId, connectData ) once the server has started and is ready to receive players. This signals brainCloud to send connection details to the waiting clients. The connectData payload will be forwarded to clients and should include the endpoint information needed to connect to your server. Clients will receive a ROOM_READY RTT event containing this data.
Session end: Call Lobby.SysRoomStopped( lobbyId ) when the game session has concluded. This signals brainCloud to clean up the session and release the associated lobby and player session records. Failing to send this call will leave orphaned session data until the system's expiry processes clean it up.
Step 5 — (Optional) Configure EventBridge
As of brainCloud 5.7, a new GameLift EventBridge option is available, allowing GameLift lifecycle events to be routed through AWS EventBridge for more flexible server event handling. This option can be enabled from within the GameLift server configuration screen in the portal.
Step 6 — Client-Side Changes
The following outlines the typical steps a game client takes to get a player into a GameLift-hosted session:
Initialize the brainCloud client — Initialize the client library with your app's
appIdandappSecret.Authenticate the user — Authenticate via any supported identity type (e.g.,
AuthenticateUniversal(),AuthenticateAnonymous(), etc.) to establish a brainCloud session.Enable RTT — Call
RTT.EnableRTT()to open the real-time connection. This is required to receive lobby and room events such asLOBBY_JOIN_SUCCESS,ROOM_ASSIGNED, andROOM_READY.Register RTT callbacks — Register callbacks to handle incoming RTT lobby events, in particular
ROOM_READY, which delivers the connectData your client will need to connect directly to the GameLift server.Find or create a lobby — Call
Lobby.FindOrCreateLobby()(orFindLobby()/CreateLobby()) to enter matchmaking. brainCloud will place the player into an appropriate lobby and launch a GameLift session when the lobby is ready to start.Connect to the game server — Upon receiving the
ROOM_READYRTT event, use the connectData payload to connect directly to the GameLift server using your game's networking layer.
Feature History
Version | What changed |
4.9 | Initial GameLift support — Room Servers, lobby/matchmaking integration, Join In Progress |
4.13 | Added Relay Server support for GameLift |
5.7 | Added GameLift EventBridge option |
References
Public setup guide (knowledgebase): Using brainCloud Lobbies with your GameLift Servers
AWS GameLift documentation: https://aws.amazon.com/gamelift/
brainCloud API docs: https://docs.braincloudservers.com
brainCloud 4.9 Release Notes: https://updates.braincloudservers.com/braincloud-4.9-is-live-3pEZl6
brainCloud 4.13 Release Notes: https://updates.braincloudservers.com/release-4.13-is-live-2JEm5y
