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.
Parameters:
-
function_name
(UnqualifiedFunctionName)
–
The name or ARN of the Lambda function.
-
qualifier
(PublishedFunctionQualifier)
–
Specify a version or alias to set the scaling configuration for a published version of the function.
-
function_scaling_config
(Optional[FunctionScalingConfig], default:
None
)
–
The scaling configuration to apply to the function, including minimum and maximum execution environment limits.
Raises:
Source code in docs_src/capo_lambda/_services/_lambda.py
| def put_function_scaling_config(
self,
function_name: "capo_lambda.types.unqualified_function_name.UnqualifiedFunctionName",
qualifier: "capo_lambda.types.published_function_qualifier.PublishedFunctionQualifier",
*,
config_overrides: Optional[LambdaClientConfig] = None,
function_scaling_config: Optional[
"capo_lambda.types.function_scaling_config.FunctionScalingConfig"
] = None,
) -> "capo_lambda.types.put_function_scaling_config_response.PutFunctionScalingConfigResponse":
"""<p>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.</p>
Args:
function_name: <p>The name or ARN of the Lambda function.</p>
qualifier: <p>Specify a version or alias to set the scaling configuration for a published version of the function.</p>
function_scaling_config: <p>The scaling configuration to apply to the function, including minimum and maximum execution environment limits.</p>
Raises:
capo_lambda.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid.</p>
capo_lambda.errors.resource_conflict_exception.ResourceConflictException: <p>The resource already exists, or another operation is in progress.</p>
capo_lambda.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
capo_lambda.errors.service_exception.ServiceException: <p>The Lambda service encountered an internal error.</p>
capo_lambda.errors.too_many_requests_exception.TooManyRequestsException: <p>The request throughput limit was exceeded. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests">Lambda quotas</a>.</p>
capo_lambda.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_lambda.types.put_function_scaling_config_request.PutFunctionScalingConfigRequest]",
) -> OperationResponse[
"capo_lambda.types.put_function_scaling_config_response.PutFunctionScalingConfigResponse"
]:
import capo_lambda._operations.aws_gir_api_service.put_function_scaling_config
output, http_response = (
capo_lambda._operations.aws_gir_api_service.put_function_scaling_config.put_function_scaling_config(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutFunctionScalingConfig")
)
input_: capo_lambda.types.put_function_scaling_config_request.PutFunctionScalingConfigRequest = {
"function_name": function_name,
"qualifier": qualifier,
}
if function_scaling_config is not None:
input_["function_scaling_config"] = function_scaling_config
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|