putFunctionScalingConfig method

Future<PutFunctionScalingConfigResponse> putFunctionScalingConfig({
  1. required String functionName,
  2. required String qualifier,
  3. FunctionScalingConfig? functionScalingConfig,
})

Sets the scaling configuration for a Lambda Managed Instances function. The scaling configuration defines the minimum and maximum number of execution environments that can be provisioned for the function, allowing you to control scaling behavior and resource allocation.

May throw InvalidParameterValueException. May throw ResourceConflictException. May throw ResourceNotFoundException. May throw ServiceException. May throw TooManyRequestsException.

Parameter functionName : The name or ARN of the Lambda function.

Parameter qualifier : Specify a version or alias to set the scaling configuration for a published version of the function.

Parameter functionScalingConfig : The scaling configuration to apply to the function, including minimum and maximum execution environment limits.

Implementation

Future<PutFunctionScalingConfigResponse> putFunctionScalingConfig({
  required String functionName,
  required String qualifier,
  FunctionScalingConfig? functionScalingConfig,
}) async {
  final $query = <String, List<String>>{
    'Qualifier': [qualifier],
  };
  final $payload = <String, dynamic>{
    if (functionScalingConfig != null)
      'FunctionScalingConfig': functionScalingConfig,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/2025-11-30/functions/${Uri.encodeComponent(functionName)}/function-scaling-config',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return PutFunctionScalingConfigResponse.fromJson(response);
}