package awskit-lwt-unix

  1. Overview
  2. Docs
Lwt Unix runtime adapter for Awskit

Install

dune-project
 Dependency

Authors

Maintainers

Sources

awskit-v0.2.0.tbz
sha256=b69c81378d08f443a276b947d9a2b45913495cb61b2ff3aa0ad74d6b071f32f8
sha512=50714b8eda6ea6e589eb34a305afdfa4870a5e8e4240c091ff5cecd309c21fdfda6163fb6449caad5cdaf800857369df5da0534d822cf152ac76fc16fb9216e5

doc/index.html

awskit-lwt-unix

Ready-to-use Lwt + Unix runtime adapter for Awskit.

The public entrypoint is Awskit_lwt_unix. This package wires the generic Lwt runtime to Cohttp Lwt Unix and the standard Unix credential and region sources.

Use it at the application edge when a Lwt service client should load AWS configuration from environment variables, shared profile files, or supported metadata sources.

Defaults And Lifecycle

Awskit_lwt_unix.create accepts explicit region and credentials. When either is omitted, the adapter reads the standard Unix sources: static environment credentials, shared AWS profile files, ECS/container credentials, and EC2 instance metadata credentials for credentials, plus AWS_REGION then AWS_DEFAULT_REGION for the region.

The credential provider chain stops on invalid configured sources and refreshes metadata credentials before expiration. IMDSv2 is preferred for EC2 metadata; tokenless IMDSv1 fallback is controlled by the imdsv1_fallback argument and AWS_EC2_METADATA_V1_DISABLED.

The runtime preserves Lwt cancellation and callback exceptions as native Lwt control flow. Response bodies are scoped to the operation callback; after a successful consumer returns, the runtime drains up to max_response_drain_bytes for connection reuse. Consumer errors take precedence over cleanup failures.

Use Awskit_lwt.Make from awskit-lwt when an application needs a custom Cohttp Lwt backend instead of the ready Unix client.