Amazonite::Core::Config
Resolves credentials, region, and endpoint for a Client.
region resolves from the constructor argument, then
AWS_REGION/AWS_DEFAULT_REGION, then the AWS profile's region.
access_key_id/secret_access_key/session_token resolve together:
if both a key and secret are given (via constructor arguments,
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY, or a static profile),
those are used as-is. Otherwise credentials come from the dynamic
provider chain - AssumeRole, SSO cached token, ECS container, then EC2
instance metadata (see the README's "Credentials" section) - and are
refreshed automatically as they near expiry.
dns_timeout/connect_timeout/read_timeout/write_timeout accept
either a Number (seconds) or a Time::Span, matching the overloads
HTTP::Client itself accepts, and default to nil (the underlying
socket library's defaults) when not given.
validate_input controls whether a generated Client calls an
operation's input's #validate! before sending the request (default
true) - set it to false to skip that check, e.g. to save the extra
pass over a large input that's already known-good.
Constants
Constructors
Instance methods
The resolved AWS profile name (constructor profile, then
AWS_PROFILE), or nil if none was found.
The base URL for endpoint_prefix (e.g. "dynamodb") - the
constructor's base_url if given, else the
AMAZONITE_<ENDPOINT_PREFIX>_URL environment variable (handy for
pointing at a local stack like LocalStack), else
https://<endpoint_prefix>.<region>.amazonaws.com.
When the current credentials expire, or nil if they don't (a
static access key/secret, or a chain provider that returned none).
nil unless the current credentials are temporary (from the
dynamic provider chain).
Yields the User-Agent string to send with a request - the
constructor's user_agent if given, else one built from the
amazonite/Crystal/LLVM versions and target architecture (cached
after the first call).