Skip to content

put_runtime_management_config async

put_runtime_management_config(
    function_name: NamespacedFunctionName,
    update_runtime_on: UpdateRuntimeOn,
    *,
    config_overrides: Optional[AsyncLambdaClientConfig] = None,
    qualifier: Optional[NumericLatestPublishedOrAliasQualifier] = None,
    runtime_version_arn: Optional[RuntimeVersionArn] = None,
) -> PutRuntimeManagementConfigResponse

Sets the runtime management configuration for a function's version. For more information, see Runtime updates.

Parameters:

  • function_name (NamespacedFunctionName) –

    The name or ARN of the Lambda function.

    Name formats

    • Function name – my-function.

    • Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN – 123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • qualifier (Optional[NumericLatestPublishedOrAliasQualifier], default: None ) –

    Specify a version of the function. This can be $LATEST or a published version number. If no value is specified, the configuration for the $LATEST version is returned.

  • update_runtime_on (UpdateRuntimeOn) –

    Specify the runtime update mode.

    • Auto (default) - Automatically update to the most recent and secure runtime version using a Two-phase runtime version rollout. This is the best choice for most customers to ensure they always benefit from runtime updates.

    • Function update - Lambda updates the runtime of your function to the most recent and secure runtime version when you update your function. This approach synchronizes runtime updates with function deployments, giving you control over when runtime updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When using this setting, you need to regularly update your functions to keep their runtime up-to-date.

    • Manual - You specify a runtime version in your function configuration. The function will use this runtime version indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows you to roll back your function to an earlier runtime version. For more information, see Roll back a runtime version.

  • runtime_version_arn (Optional[RuntimeVersionArn], default: None ) –

    The ARN of the runtime version you want the function to use.

    This is only required if you're using the Manual runtime update mode.

Raises:

Source code in docs_src/capo_lambda/_services/async__lambda.py
async def put_runtime_management_config(
    self,
    function_name: "capo_lambda.types.namespaced_function_name.NamespacedFunctionName",
    update_runtime_on: "capo_lambda.types.update_runtime_on.UpdateRuntimeOn",
    *,
    config_overrides: Optional[AsyncLambdaClientConfig] = None,
    qualifier: Optional[
        "capo_lambda.types.numeric_latest_published_or_alias_qualifier.NumericLatestPublishedOrAliasQualifier"
    ] = None,
    runtime_version_arn: Optional[
        "capo_lambda.types.runtime_version_arn.RuntimeVersionArn"
    ] = None,
) -> "capo_lambda.types.put_runtime_management_config_response.PutRuntimeManagementConfigResponse":
    """<p>Sets the runtime management configuration for a function's version. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html">Runtime updates</a>.</p>

    Args:
        function_name: <p>The name or ARN of the Lambda function.</p> <p class="title"> <b>Name formats</b> </p> <ul> <li> <p> <b>Function name</b> – <code>my-function</code>.</p> </li> <li> <p> <b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p> </li> <li> <p> <b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p> </li> </ul> <p>The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
        qualifier: <p>Specify a version of the function. This can be <code>$LATEST</code> or a published version number. If no value is specified, the configuration for the <code>$LATEST</code> version is returned.</p>
        update_runtime_on: <p>Specify the runtime update mode.</p> <ul> <li> <p> <b>Auto (default)</b> - Automatically update to the most recent and secure runtime version using a <a href="https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-two-phase">Two-phase runtime version rollout</a>. This is the best choice for most customers to ensure they always benefit from runtime updates.</p> </li> <li> <p> <b>Function update</b> - Lambda updates the runtime of your function to the most recent and secure runtime version when you update your function. This approach synchronizes runtime updates with function deployments, giving you control over when runtime updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When using this setting, you need to regularly update your functions to keep their runtime up-to-date.</p> </li> <li> <p> <b>Manual</b> - You specify a runtime version in your function configuration. The function will use this runtime version indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows you to roll back your function to an earlier runtime version. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-rollback">Roll back a runtime version</a>.</p> </li> </ul>
        runtime_version_arn: <p>The ARN of the runtime version you want the function to use.</p> <note> <p>This is only required if you're using the <b>Manual</b> runtime update mode.</p> </note>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_lambda.types.put_runtime_management_config_request.PutRuntimeManagementConfigRequest]",
    ) -> AsyncOperationResponse[
        "capo_lambda.types.put_runtime_management_config_response.PutRuntimeManagementConfigResponse"
    ]:
        import capo_lambda._operations.aws_gir_api_service.put_runtime_management_config

        (
            output,
            http_response,
        ) = await capo_lambda._operations.aws_gir_api_service.put_runtime_management_config.async_put_runtime_management_config(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutRuntimeManagementConfig")
    )
    input_: capo_lambda.types.put_runtime_management_config_request.PutRuntimeManagementConfigRequest = {
        "function_name": function_name,
        "update_runtime_on": update_runtime_on,
    }
    if qualifier is not None:
        input_["qualifier"] = qualifier
    if runtime_version_arn is not None:
        input_["runtime_version_arn"] = runtime_version_arn

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output