Module erlcloud_aws

Data Types

http_client_headers()

http_client_headers() = [{string(), string()}]

http_client_result()

http_client_result() = result()

from lhttpc_types.hrl

httpc_result()

httpc_result() = {ok, httpc_result_ok()} | {error, httpc_result_error()}

httpc_result_error()

httpc_result_error() = {http_error, Status::pos_integer(), StatusLine::string(), Body::binary()} | {socket_error, Reason::term()}

httpc_result_ok()

httpc_result_ok() = {http_client_headers(), binary()}

profile_option()

profile_option() = {role_session_name, string()} | {role_session_secs, 900..43200}

Function Index

auto_config/0Generate config using the best available credentials.
auto_config/1Generate config using the best available credentials.
aws_region_from_host/1
aws_request/5
aws_request/6
aws_request/7
aws_request/8
aws_request2/7
aws_request4/8
aws_request4/9
aws_request_form/8
aws_request_form_raw/8
aws_request_xml/5
aws_request_xml/6
aws_request_xml/7
aws_request_xml/8
aws_request_xml2/5
aws_request_xml2/7
aws_request_xml4/6
aws_request_xml4/8
clear_config/1
clear_expired_configs/0
configure/1
default_config/0
default_config_override/1
default_config_region/2
do_aws_request_form_raw/9
format_timestamp/1
get_host_vpc_endpoint/2
get_service_status/1
get_timeout/1
get_vpc_endpoints/0
http_body/1
http_headers_body/1
is_throttling_error_response/1
param_list/2
profile/0Retrieve a config based on default credentials.
profile/1Retrieve a config based on named credentials profile.
profile/2Retrieve a config based on named credentials profile.
request_to_return/1
service_config/3Generate config updated to work with specified AWS service and region.
sign_v4/8
sign_v4_headers/5
update_config/1

Function Details

auto_config/0

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:

  1. Environment Variables

    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.

  2. User Profile

    The default user profile credentials will be sourced using the profile/0 function, if available for the current user.

  3. ECS Task Role

    The credentials available via ECS Task Role will be sourced, if available.

  4. Host Metadata

    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.

If none of these credential sources are available, this function will return undefined.

auto_config/1

auto_config(ProfileOptions::[{profile, atom()} | profile_option()]) -> {ok, aws_config()} | undefined

Generate config using the best available credentials

This function works the same as auto_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/1

aws_region_from_host(Host) -> any()

aws_request/5

aws_request(Method, Host, Path, Params, Aws_config) -> any()

aws_request/6

aws_request(Method, Host, Path, Params, AccessKeyID, SecretAccessKey) -> any()

aws_request/7

aws_request(Method, Protocol, Host, Port, Path, Params, Aws_config) -> any()

aws_request/8

aws_request(Method, Protocol, Host, Port, Path, Params, AccessKeyID, SecretAccessKey) -> any()

aws_request2/7

aws_request2(Method, Protocol, Host, Port, Path, Params, Config) -> any()

aws_request4/8

aws_request4(Method, Protocol, Host, Port, Path, Params, Service, Config) -> any()

aws_request4/9

aws_request4(Method, Protocol, Host, Port, Path, Params, Service, Headers, Config) -> any()

aws_request_form/8

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/8

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/5

aws_request_xml(Method, Host, Path, Params, Aws_config) -> any()

aws_request_xml/6

aws_request_xml(Method, Host, Path, Params, AccessKeyID, SecretAccessKey) -> any()

aws_request_xml/7

aws_request_xml(Method, Protocol, Host, Port, Path, Params, Aws_config) -> any()

aws_request_xml/8

aws_request_xml(Method, Protocol, Host, Port, Path, Params, AccessKeyID, SecretAccessKey) -> any()

aws_request_xml2/5

aws_request_xml2(Method, Host, Path, Params, Aws_config) -> any()

aws_request_xml2/7

aws_request_xml2(Method, Protocol, Host, Port, Path, Params, Aws_config) -> any()

aws_request_xml4/6

aws_request_xml4(Method, Host, Path, Params, Service, Aws_config) -> any()

aws_request_xml4/8

aws_request_xml4(Method, Protocol, Host, Port, Path, Params, Service, Aws_config) -> any()

clear_config/1

clear_config(Aws_config::aws_config()) -> ok

clear_expired_configs/0

clear_expired_configs() -> ok

configure/1

configure(Aws_config::aws_config()) -> {ok, aws_config()}

default_config/0

default_config() -> aws_config()

default_config_override/1

default_config_override(AwsConfig) -> any()

default_config_region/2

default_config_region(AwsConfig, Region) -> any()

do_aws_request_form_raw/9

do_aws_request_form_raw(Method, Scheme, Host, Port, Path, Form, Headers, Config, ShowRespHeaders) -> any()

format_timestamp/1

format_timestamp(X1) -> any()

get_host_vpc_endpoint/2

get_host_vpc_endpoint(Service::binary(), Default::binary()) -> binary()

get_service_status/1

get_service_status(ServiceNames::[string()]) -> ok | list()

get_timeout/1

get_timeout(Aws_config) -> any()

get_vpc_endpoints/0

get_vpc_endpoints() -> [{binary(), binary()}]

http_body/1

http_body(Return::http_client_result()) -> {ok, Body::binary()} | {error, httpc_result_error()}

http_headers_body/1

http_headers_body(X1::http_client_result()) -> httpc_result()

is_throttling_error_response/1

is_throttling_error_response(Aws_request::aws_request()) -> true | false

param_list/2

param_list(Values, Key) -> any()

profile/0

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/1

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/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:

request_to_return/1

request_to_return(Aws_request) -> any()

service_config/3

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/8

sign_v4(Method::atom(), Uri::list(), Config::aws_config(), Headers::headers(), Payload::string() | binary(), Region::string(), Service::string(), QueryParams::list()) -> headers()

sign_v4_headers/5

sign_v4_headers(Config::aws_config(), Headers::headers(), Payload::string() | binary(), Region::string(), Service::string()) -> headers()

update_config/1

update_config(Aws_config::aws_config()) -> {ok, aws_config()} | {error, metadata_not_available | container_credentials_unavailable | httpc_result_error()}


Generated by EDoc