class
Amazonite::Core::Config
- Amazonite::Core::Config
- Reference
- Object
Overview
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.
Defined in:
core/config.crConstant Summary
-
Log =
::Log.for(self)
Constructors
Instance Method Summary
- #access_key_id : String
-
#aws_profile
The resolved AWS profile name (constructor
profile, thenAWS_PROFILE), ornilif none was found. - #base_url : String?
- #connect_timeout : Time::Span?
- #dns_timeout : Time::Span?
-
#endpoint_url(endpoint_prefix) : String
The base URL for
endpoint_prefix(e.g. -
#expiration : Time | Nil
When the current credentials expire, or
nilif they don't (a static access key/secret, or a chain provider that returned none). - #read_timeout : Time::Span?
- #region : String
- #secret_access_key : String
-
#session_token : String | Nil
nilunless the current credentials are temporary (from the dynamic provider chain). -
#user_agent(&) : String
Yields the
User-Agentstring to send with a request - the constructor's#user_agentif given, else one built from the amazonite/Crystal/LLVM versions and target architecture (cached after the first call). - #validate_input? : Bool
- #write_timeout : Time::Span?
Constructor Detail
Instance Method Detail
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).