def from_env
import bend-kit-sigv4@0.11.0.1/sigv4.bend as Sigv4import Base
503# AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN; AWS_REGION, else AWS_DEFAULT_REGION, else us-east-1;
504# AWS_ENDPOINT_URL_S3, else AWS_ENDPOINT_URL. A custom endpoint is path-style, as MinIO wants; AWS is virtual-hosted.
505def from_env() -> IO(Result<&1, &1, Err, Config>):
506 do IO<Result<&1, &1, Err, Config>>:
507 a : Result<&1, &1, U32 & String, String> <- IO.get_env("AWS_ACCESS_KEY_ID")
508 s : Result<&1, &1, U32 & String, String> <- IO.get_env("AWS_SECRET_ACCESS_KEY")
509 t : Result<&1, &1, U32 & String, String> <- IO.get_env("AWS_SESSION_TOKEN")
510 r : Result<&1, &1, U32 & String, String> <- IO.get_env("AWS_REGION")
511 dr : Result<&1, &1, U32 & String, String> <- IO.get_env("AWS_DEFAULT_REGION")
512 e3 : Result<&1, &1, U32 & String, String> <- IO.get_env("AWS_ENDPOINT_URL_S3")
513 e : Result<&1, &1, U32 & String, String> <- IO.get_env("AWS_ENDPOINT_URL")
514 return from_env.of(env(a), env(s), env(t), or(env(r), or(env(dr), "us-east-1")), or(env(e3), env(e)))
Uses (13)
Used by (0)
No other definition uses this definition.