http_client_headers() = [{string(), string()}]
http_client_result() = result()
from lhttpc_types.hrl
httpc_result() = {ok, httpc_result_ok()} | {error, httpc_result_error()}
httpc_result_error() = {http_error, Status::pos_integer(), StatusLine::string(), Body::binary()} | {socket_error, Reason::term()}
httpc_result_ok() = {http_client_headers(), binary()}
profile_option() = {role_session_name, string()} | {role_session_secs, 900..43200}
auto_config() -> {ok, aws_config()} | undefined
Generate config using the best available credentials
This function will generate a valid #aws_config{}
based on
the best available credentials source in the current environment. The
following sources of credentials will be used, in order:
An Id, Key and optionally Token, will be sourced from the
environment variables AWS_ACCESS_KEY_ID
,
AWS_SECRET_ACCESS_KEY
and
AWS_SECURITY_TOKEN
respectively. Both the Id and Key
values must be non-empty for this form of credentials to be considered
valid.
The default user profile credentials will be sourced using the
profile/0
function, if available for the current user.
The credentials available via ECS Task Role will be sourced, if available.
The credentials available via host metadata will be sourced, if available.
Alike default_config/0
this function will also check AWS_REGION
variable and
will try to set the appropriate URL for this region for each service.
undefined
.
auto_config(ProfileOptions::[{profile, atom()} | profile_option()]) -> {ok, aws_config()} | undefined
Generate config using the best available credentials
This function works the same asauto_config/0
, but if credentials
are developed from User Profile as the source, the
Options
parameter provided will be used to control the
behavior. The credential profile name choosen can be controlled by
providing {profile, atom()}
as part of the options, and if
not specified the default
profile will be used.
See also: profile/2.
aws_region_from_host(Host) -> any()
aws_request(Method, Host, Path, Params, Aws_config) -> any()
aws_request(Method, Host, Path, Params, AccessKeyID, SecretAccessKey) -> any()
aws_request(Method, Protocol, Host, Port, Path, Params, Aws_config) -> any()
aws_request(Method, Protocol, Host, Port, Path, Params, AccessKeyID, SecretAccessKey) -> any()
aws_request2(Method, Protocol, Host, Port, Path, Params, Config) -> any()
aws_request4(Method, Protocol, Host, Port, Path, Params, Service, Config) -> any()
aws_request4(Method, Protocol, Host, Port, Path, Params, Service, Headers, Config) -> any()
aws_request_form(Method::atom(), Protocol::undefined | string(), Host::string(), Port::undefined | integer() | string(), Path::string(), Form::[string()], Headers::list(), Config::aws_config()) -> {ok, Body::binary()} | {error, httpc_result_error()}
aws_request_form_raw(Method::atom(), Scheme::string() | [string()], Host::string(), Port::undefined | integer() | string(), Path::string(), Form::iodata(), Headers::list(), Config::aws_config()) -> {ok, Body::binary()} | {error, httpc_result_error()}
aws_request_xml(Method, Host, Path, Params, Aws_config) -> any()
aws_request_xml(Method, Host, Path, Params, AccessKeyID, SecretAccessKey) -> any()
aws_request_xml(Method, Protocol, Host, Port, Path, Params, Aws_config) -> any()
aws_request_xml(Method, Protocol, Host, Port, Path, Params, AccessKeyID, SecretAccessKey) -> any()
aws_request_xml2(Method, Host, Path, Params, Aws_config) -> any()
aws_request_xml2(Method, Protocol, Host, Port, Path, Params, Aws_config) -> any()
aws_request_xml4(Method, Host, Path, Params, Service, Aws_config) -> any()
aws_request_xml4(Method, Protocol, Host, Port, Path, Params, Service, Aws_config) -> any()
clear_config(Aws_config::aws_config()) -> ok
clear_expired_configs() -> ok
configure(Aws_config::aws_config()) -> {ok, aws_config()}
default_config() -> aws_config()
default_config_override(AwsConfig) -> any()
default_config_region(AwsConfig, Region) -> any()
do_aws_request_form_raw(Method, Scheme, Host, Port, Path, Form, Headers, Config, ShowRespHeaders) -> any()
format_timestamp(X1) -> any()
get_host_vpc_endpoint(Service::binary(), Default::binary()) -> binary()
get_service_status(ServiceNames::[string()]) -> ok | list()
get_timeout(Aws_config) -> any()
get_vpc_endpoints() -> [{binary(), binary()}]
http_body(Return::http_client_result()) -> {ok, Body::binary()} | {error, httpc_result_error()}
http_headers_body(X1::http_client_result()) -> httpc_result()
is_throttling_error_response(Aws_request::aws_request()) -> true | false
param_list(Values, Key) -> any()
profile() -> {ok, aws_config()} | {error, string()}
Retrieve a config based on default credentials
This function will retrieve the credentials for the default profile, in the same way as the AWS CLI tools, and construct a config record to be used accessing services.See also: profile/2.
profile(Name::atom()) -> {ok, aws_config()} | {error, string()}
Retrieve a config based on named credentials profile
This function will retrieve the credentials for the named profile, in the same way as the AWS CLI tools, and construct a config record to be used accessing services.See also: profile/2.
profile(Name::atom(), Options::[profile_option()]) -> {ok, aws_config()} | {error, string()}
Retrieve a config based on named credentials profile
This function will read the $HOME/.aws/credentials
file used
by the AWS CLI tools and construct a config record
to be used accessing services for the named profile. This supports both
direct credentials that appear in the profile:
[default]
aws_access_key_id = XXXXXXXXXXXXXXXXXXX2
aws_secret_access_key = yyyyyyyyyyyyyyyyyyyyyyyyyy+yyyy/yyyyyyyy2
as well as indirection using source_profile:
[foo]
source_profile = default
Finally, it supports the role_arn specification, and will assume the role indicated using the current credentials when interpreting the profile in which they it is declared:
[foo]
role_arn=arn:aws:iam::892406118791:role/centralized-users
source_profile = default
When using the role_arn specification, you may supply the following two options to control the way in which the assume_role request is made via AWS STS service:
'role_session_name'
The name that should be used
for the RoleSessionName
parameter. If this option is not
specified, then it will default to "erlcloud"
'role_duration_secs'
The number of seconds that
should be used for the DurationSeconds
parameter. If
this option is not specified, then it will default to 900 seconds.
'external_id'
The identifier that is used in the ExternalId
parameter. If this option isn't specified, then it will default to
'undefined', which will work for normal in-account roles, but will
need to be specified for roles in external accounts.
request_to_return(Aws_request) -> any()
service_config(Service::atom() | string() | binary(), Region::atom() | string() | binary(), Config::#aws_config{}) -> #aws_config{}
Generate config updated to work with specified AWS service and region
This function will generate a new configuration, based on the one provided, and configured to access the specified AWS service in the specified region. If called for a service without a region based endpoint, the config provided will be returned unaltered.
If an invalid service name is provided, then this will throw an error, presuming that this is just a coding error. This behavior allows the chaining of calls to this interface to allow concise configuraiton of a config for multiple services.sign_v4(Method::atom(), Uri::list(), Config::aws_config(), Headers::headers(), Payload::string() | binary(), Region::string(), Service::string(), QueryParams::list()) -> headers()
sign_v4_headers(Config::aws_config(), Headers::headers(), Payload::string() | binary(), Region::string(), Service::string()) -> headers()
update_config(Aws_config::aws_config()) -> {ok, aws_config()} | {error, metadata_not_available | container_credentials_unavailable | httpc_result_error()}
Generated by EDoc