updateRuntimeConfiguration method

Future<UpdateRuntimeConfigurationOutput> updateRuntimeConfiguration({
  1. required String fleetId,
  2. required RuntimeConfiguration runtimeConfiguration,
})

Updates the current runtime configuration for the specified fleet, which tells Amazon GameLift how to launch server processes on instances in the fleet. You can update a fleet's runtime configuration at any time after the fleet is created; it does not need to be in an ACTIVE status.

To update runtime configuration, specify the fleet ID and provide a RuntimeConfiguration object with an updated set of server process configurations.

Each instance in a Amazon GameLift fleet checks regularly for an updated runtime configuration and changes how it launches server processes to comply with the latest version. Existing server processes are not affected by the update; runtime configuration changes are applied gradually as existing processes shut down and new processes are launched during Amazon GameLift's normal process recycling activity.

Learn more

Setting up GameLift Fleets

Related operations

May throw UnauthorizedException. May throw NotFoundException. May throw InternalServiceException. May throw InvalidRequestException. May throw InvalidFleetStatusException.

Parameter fleetId : A unique identifier for a fleet to update runtime configuration for. You can use either the fleet ID or ARN value.

Parameter runtimeConfiguration : Instructions for launching server processes on each instance in the fleet. Server processes run either a custom game build executable or a Realtime Servers script. The runtime configuration lists the types of server processes to run on an instance and includes the following configuration settings: the server executable or launch script file, launch parameters, and the number of processes to run concurrently on each instance. A CreateFleet request must include a runtime configuration with at least one server process configuration.

Implementation

Future<UpdateRuntimeConfigurationOutput> updateRuntimeConfiguration({
  required String fleetId,
  required RuntimeConfiguration runtimeConfiguration,
}) async {
  ArgumentError.checkNotNull(fleetId, 'fleetId');
  ArgumentError.checkNotNull(runtimeConfiguration, 'runtimeConfiguration');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GameLift.UpdateRuntimeConfiguration'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'FleetId': fleetId,
      'RuntimeConfiguration': runtimeConfiguration,
    },
  );

  return UpdateRuntimeConfigurationOutput.fromJson(jsonResponse.body);
}