Skip to content

put_function_code_signing_config

put_function_code_signing_config(
    code_signing_config_arn: CodeSigningConfigArn,
    function_name: NamespacedFunctionName,
    *,
    config_overrides: Optional[LambdaClientConfig] = None,
) -> PutFunctionCodeSigningConfigResponse

Update the code signing configuration for the function. Changes to the code signing configuration take effect the next time a user tries to deploy a code package to the function.

Parameters:

  • code_signing_config_arn (CodeSigningConfigArn) –

    The The Amazon Resource Name (ARN) of the code signing configuration.

  • function_name (NamespacedFunctionName) –

    The name or ARN of the Lambda function.

    Name formats

    • Function name - MyFunction.

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

    • Partial ARN - 123456789012:function:MyFunction.

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

Raises:

Source code in docs_src/capo_lambda/_services/_lambda.py
def put_function_code_signing_config(
    self,
    code_signing_config_arn: "capo_lambda.types.code_signing_config_arn.CodeSigningConfigArn",
    function_name: "capo_lambda.types.namespaced_function_name.NamespacedFunctionName",
    *,
    config_overrides: Optional[LambdaClientConfig] = None,
) -> "capo_lambda.types.put_function_code_signing_config_response.PutFunctionCodeSigningConfigResponse":
    """<p>Update the code signing configuration for the function. Changes to the code signing configuration take effect the next time a user tries to deploy a code package to the function. </p>

    Args:
        code_signing_config_arn: <p>The The Amazon Resource Name (ARN) of the code signing configuration.</p>
        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>MyFunction</code>.</p> </li> <li> <p> <b>Function ARN</b> - <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p> </li> <li> <p> <b>Partial ARN</b> - <code>123456789012:function:MyFunction</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>

    Raises:
        capo_lambda.errors.code_signing_config_not_found_exception.CodeSigningConfigNotFoundException: <p>The specified code signing configuration does not exist.</p>
        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_code_signing_config_request.PutFunctionCodeSigningConfigRequest]",
    ) -> OperationResponse[
        "capo_lambda.types.put_function_code_signing_config_response.PutFunctionCodeSigningConfigResponse"
    ]:
        import capo_lambda._operations.aws_gir_api_service.put_function_code_signing_config

        output, http_response = (
            capo_lambda._operations.aws_gir_api_service.put_function_code_signing_config.put_function_code_signing_config(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutFunctionCodeSigningConfig")
    )
    input_: capo_lambda.types.put_function_code_signing_config_request.PutFunctionCodeSigningConfigRequest = {
        "code_signing_config_arn": code_signing_config_arn,
        "function_name": function_name,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output