Module Values.InvocationResponseSource

Invokes a Lambda function. You can invoke a function synchronously (and wait for the response), or asynchronously. By default, Lambda invokes your function synchronously (i.e. theInvocationType is RequestResponse). To invoke a function asynchronously, set InvocationType to Event. Lambda passes the ClientContext object to your function for synchronous invocations only. For synchronous invocations, the maximum payload size is 6 MB. For asynchronous invocations, the maximum payload size is 1 MB. For synchronous invocation, details about the function response, including errors, are included in the response body and headers. For either invocation type, you can find more information in the execution log and trace. When an error occurs, your function may be invoked multiple times. Retry behavior varies by error type, client, event source, and invocation type. For example, if you invoke a function asynchronously and it returns an error, Lambda executes the function up to two more times. For more information, see Error handling and automatic retries in Lambda. For asynchronous invocation, Lambda adds events to a queue before sending them to your function. If your function does not have enough capacity to keep up with the queue, events may be lost. Occasionally, your function may receive the same event multiple times, even if no error occurs. To retain events that were not processed, configure your function with a dead-letter queue. The status code in the API response doesn't reflect function errors. Error codes are reserved for errors that prevent your function from executing, such as permissions errors, quota errors, or issues with your function's code and configuration. For example, Lambda returns TooManyRequestsException if running the function would cause you to exceed a concurrency limit at either the account level (ConcurrentInvocationLimitExceeded) or function level (ReservedFunctionConcurrentInvocationLimitExceeded). For functions with a long timeout, your client might disconnect during synchronous invocation while it waits for a response. Configure your HTTP client, SDK, firewall, proxy, or operating system to allow for long connections with timeout or keep-alive settings. This operation requires permission for the lambda:InvokeFunction action. For details on how to set up permissions for cross-account invocations, see Granting function access to other accounts.

Sourcetype nonrec t = {
  1. statusCode : Integer.t option;
    (*

    The HTTP status code is in the 200 range for a successful request. For the RequestResponse invocation type, this status code is 200. For the Event invocation type, this status code is 202. For the DryRun invocation type, the status code is 204.

    *)
  2. functionError : String_.t option;
    (*

    If present, indicates that an error occurred during function execution. Details about the error are included in the response payload.

    *)
  3. logResult : String_.t option;
    (*

    The last 4 KB of the execution log, which is base64-encoded.

    *)
  4. payload : Blob.t option;
    (*

    The response from the function, or an error object.

    *)
  5. executedVersion : Version.t option;
    (*

    The version of the function that executed. When you invoke a function with an alias, this indicates which version the alias resolved to.

    *)
  6. durableExecutionArn : DurableExecutionArn.t option;
    (*

    The ARN of the durable execution that was started. This is returned when invoking a durable function and provides a unique identifier for tracking the execution.

    *)
}
Sourcetype nonrec error = [
  1. | `DurableExecutionAlreadyStartedException of DurableExecutionAlreadyStartedException.t
  2. | `EC2AccessDeniedException of EC2AccessDeniedException.t
  3. | `EC2ThrottledException of EC2ThrottledException.t
  4. | `EC2UnexpectedException of EC2UnexpectedException.t
  5. | `EFSIOException of EFSIOException.t
  6. | `EFSMountConnectivityException of EFSMountConnectivityException.t
  7. | `EFSMountFailureException of EFSMountFailureException.t
  8. | `EFSMountTimeoutException of EFSMountTimeoutException.t
  9. | `ENILimitReachedException of ENILimitReachedException.t
  10. | `InvalidParameterValueException of InvalidParameterValueException.t
  11. | `InvalidRequestContentException of InvalidRequestContentException.t
  12. | `InvalidRuntimeException of InvalidRuntimeException.t
  13. | `InvalidSecurityGroupIDException of InvalidSecurityGroupIDException.t
  14. | `InvalidSubnetIDException of InvalidSubnetIDException.t
  15. | `InvalidZipFileException of InvalidZipFileException.t
  16. | `KMSAccessDeniedException of KMSAccessDeniedException.t
  17. | `KMSDisabledException of KMSDisabledException.t
  18. | `KMSInvalidStateException of KMSInvalidStateException.t
  19. | `KMSNotFoundException of KMSNotFoundException.t
  20. | `NoPublishedVersionException of NoPublishedVersionException.t
  21. | `RecursiveInvocationException of RecursiveInvocationException.t
  22. | `RequestTooLargeException of RequestTooLargeException.t
  23. | `ResourceConflictException of ResourceConflictException.t
  24. | `ResourceNotFoundException of ResourceNotFoundException.t
  25. | `ResourceNotReadyException of ResourceNotReadyException.t
  26. | `S3FilesMountConnectivityException of S3FilesMountConnectivityException.t
  27. | `S3FilesMountFailureException of S3FilesMountFailureException.t
  28. | `S3FilesMountTimeoutException of S3FilesMountTimeoutException.t
  29. | `SerializedRequestEntityTooLargeException of SerializedRequestEntityTooLargeException.t
  30. | `ServiceException of ServiceException.t
  31. | `SnapStartException of SnapStartException.t
  32. | `SnapStartNotReadyException of SnapStartNotReadyException.t
  33. | `SnapStartTimeoutException of SnapStartTimeoutException.t
  34. | `SubnetIPAddressLimitReachedException of SubnetIPAddressLimitReachedException.t
  35. | `TooManyRequestsException of TooManyRequestsException.t
  36. | `UnsupportedMediaTypeException of UnsupportedMediaTypeException.t
  37. | `Unknown_operation_error of string * string option
]
Sourceval make : ?statusCode:??? -> ?functionError:??? -> ?logResult:??? -> ?payload:??? -> ?executedVersion:??? -> ?durableExecutionArn:??? -> unit -> t
Sourceval error_of_json : string -> Yojson.Safe.t -> [> `DurableExecutionAlreadyStartedException of DurableExecutionAlreadyStartedException.t | `EC2AccessDeniedException of EC2AccessDeniedException.t | `EC2ThrottledException of EC2ThrottledException.t | `EC2UnexpectedException of EC2UnexpectedException.t | `EFSIOException of EFSIOException.t | `EFSMountConnectivityException of EFSMountConnectivityException.t | `EFSMountFailureException of EFSMountFailureException.t | `EFSMountTimeoutException of EFSMountTimeoutException.t | `ENILimitReachedException of ENILimitReachedException.t | `InvalidParameterValueException of InvalidParameterValueException.t | `InvalidRequestContentException of InvalidRequestContentException.t | `InvalidRuntimeException of InvalidRuntimeException.t | `InvalidSecurityGroupIDException of InvalidSecurityGroupIDException.t | `InvalidSubnetIDException of InvalidSubnetIDException.t | `InvalidZipFileException of InvalidZipFileException.t | `KMSAccessDeniedException of KMSAccessDeniedException.t | `KMSDisabledException of KMSDisabledException.t | `KMSInvalidStateException of KMSInvalidStateException.t | `KMSNotFoundException of KMSNotFoundException.t | `NoPublishedVersionException of NoPublishedVersionException.t | `RecursiveInvocationException of RecursiveInvocationException.t | `RequestTooLargeException of RequestTooLargeException.t | `ResourceConflictException of ResourceConflictException.t | `ResourceNotFoundException of ResourceNotFoundException.t | `ResourceNotReadyException of ResourceNotReadyException.t | `S3FilesMountConnectivityException of S3FilesMountConnectivityException.t | `S3FilesMountFailureException of S3FilesMountFailureException.t | `S3FilesMountTimeoutException of S3FilesMountTimeoutException.t | `SerializedRequestEntityTooLargeException of SerializedRequestEntityTooLargeException.t | `ServiceException of ServiceException.t | `SnapStartException of SnapStartException.t | `SnapStartNotReadyException of SnapStartNotReadyException.t | `SnapStartTimeoutException of SnapStartTimeoutException.t | `SubnetIPAddressLimitReachedException of SubnetIPAddressLimitReachedException.t | `TooManyRequestsException of TooManyRequestsException.t | `Unknown_operation_error of string * string option | `UnsupportedMediaTypeException of UnsupportedMediaTypeException.t ]
Sourceval error_of_xml : string -> Awso.Xml.t -> [> `DurableExecutionAlreadyStartedException of DurableExecutionAlreadyStartedException.t | `EC2AccessDeniedException of EC2AccessDeniedException.t | `EC2ThrottledException of EC2ThrottledException.t | `EC2UnexpectedException of EC2UnexpectedException.t | `EFSIOException of EFSIOException.t | `EFSMountConnectivityException of EFSMountConnectivityException.t | `EFSMountFailureException of EFSMountFailureException.t | `EFSMountTimeoutException of EFSMountTimeoutException.t | `ENILimitReachedException of ENILimitReachedException.t | `InvalidParameterValueException of InvalidParameterValueException.t | `InvalidRequestContentException of InvalidRequestContentException.t | `InvalidRuntimeException of InvalidRuntimeException.t | `InvalidSecurityGroupIDException of InvalidSecurityGroupIDException.t | `InvalidSubnetIDException of InvalidSubnetIDException.t | `InvalidZipFileException of InvalidZipFileException.t | `KMSAccessDeniedException of KMSAccessDeniedException.t | `KMSDisabledException of KMSDisabledException.t | `KMSInvalidStateException of KMSInvalidStateException.t | `KMSNotFoundException of KMSNotFoundException.t | `NoPublishedVersionException of NoPublishedVersionException.t | `RecursiveInvocationException of RecursiveInvocationException.t | `RequestTooLargeException of RequestTooLargeException.t | `ResourceConflictException of ResourceConflictException.t | `ResourceNotFoundException of ResourceNotFoundException.t | `ResourceNotReadyException of ResourceNotReadyException.t | `S3FilesMountConnectivityException of S3FilesMountConnectivityException.t | `S3FilesMountFailureException of S3FilesMountFailureException.t | `S3FilesMountTimeoutException of S3FilesMountTimeoutException.t | `SerializedRequestEntityTooLargeException of SerializedRequestEntityTooLargeException.t | `ServiceException of ServiceException.t | `SnapStartException of SnapStartException.t | `SnapStartNotReadyException of SnapStartNotReadyException.t | `SnapStartTimeoutException of SnapStartTimeoutException.t | `SubnetIPAddressLimitReachedException of SubnetIPAddressLimitReachedException.t | `TooManyRequestsException of TooManyRequestsException.t | `Unknown_operation_error of string * string option | `UnsupportedMediaTypeException of UnsupportedMediaTypeException.t ]
Sourceval error_to_json : error -> Yojson.Safe.t
Sourceval of_header_and_body : ((string, String_.t) Awso.Import.List.Assoc.t * Blob.t) -> t
Sourceval to_value : t -> [> `Structure of (string * [> `Blob of Blob.t | `Integer of Integer.t | `String of String_.t ]) list ]
Sourceval to_query : t -> Awso.Client.Query.t
Sourceval of_xml : Awso.Xml.t -> t
Sourceval of_string : string -> t
Sourceval of_json : Yojson.Safe.t -> t
Sourceval to_json : t -> Yojson.Safe.t