aws_credentials (aws_credentials v1.0.3)

View Source

This is the main interface to the library. It provides a function get_credentials/0 which should return Credentials :: map() or undefined. If undefined, it will attempt to get credentials again after 5 seconds delay.

Summary

Functions

Force a credentials update (using the application environment options if any).

Force a credentials update, passing options (which possibly override the options set in the erlang environment.)

Get cached credential information.

Start the server that stores and automatically updates client credentials fetched from the instance metadata service.

Stop the server that holds the credentials.

Types

access_key_id/0

-type access_key_id() :: binary().

credentials/0

-type credentials() ::
          #{credential_provider := aws_credentials_provider:provider(),
            access_key_id := access_key_id(),
            secret_access_key := secret_access_key(),
            token => token(),
            region => region()}.

region/0

-type region() :: binary().

secret_access_key/0

-type secret_access_key() :: binary().

state/0

-opaque state()

token/0

-type token() :: binary().

Functions

code_change(Prev, State, Extra)

-spec code_change(any(), state(), any()) -> {ok, state()}.

force_credentials_refresh()

-spec force_credentials_refresh() -> credentials() | undefined | {error, any()}.

Force a credentials update (using the application environment options if any).

force_credentials_refresh(Options)

-spec force_credentials_refresh(aws_credentials_provider:options()) ->
                                   credentials() | undefined | {error, any()}.

Force a credentials update, passing options (which possibly override the options set in the erlang environment.)

format_status(Status)

-spec format_status(gen_server:format_status()) -> gen_server:format_status().

get_credentials()

-spec get_credentials() -> credentials() | undefined.

Get cached credential information.

handle_call(Args, From, State)

-spec handle_call(any(), any(), state()) -> {noreply, _} | {reply, any(), state()}.

handle_cast(Message, State)

-spec handle_cast(any(), state()) -> {noreply, state()}.

handle_info(Message, State)

-spec handle_info(any(), state()) -> {noreply, state()}.

init(Args)

-spec init(_) -> {ok, state()}.

make_map(Provider, AccessId, SecretKey)

make_map(Provider, AccessId, SecretKey, Token)

make_map(Provider, AccessId, SecretKey, Token, Region)

start_link()

-spec start_link() -> {ok, pid()}.

Start the server that stores and automatically updates client credentials fetched from the instance metadata service.

stop()

-spec stop() -> ok.

Stop the server that holds the credentials.

terminate(Reason, State)

-spec terminate(any(), state()) -> ok.