AWS.Client (aws-elixir v0.8.0) View Source

Provides credentials and connection details for making requests to AWS services.

You can configure access_key_id and secret_access_key which are the credentials needed by IAM, and also the region for your services. The list of regions can be found in the AWS service endpoints documentation. You can also use "local" to make requests to your localhost. Note that the region is overwritten with the credential scope when the service is global.

Custom HTTP client

The option http_client accepts a tuple with a module and a list of options. The module must implement the callback AWS.HTTPClient.request/5.

Custom JSON or XML parsers

You can configure a custom JSON parser by using the option json_module. This option accepts a tuple with a module and options. The given module must implement the callbacks from AWS.JSON.

Similarly, there is a xml_module option that configures the XML parser. The XML module must implement the callbacks from AWS.XML.

Additional options

  • session_token: an option to set the X-Amz-Security-Token when performing the requests.
  • port: is the port to use when making requests. By default is 443
  • proto: is the protocol to use. It can be "http" or "https". By default it's "https".
  • endpoint: AWS's endpoint. By default it is amazonaws.com.

The service option is overwritten by each service with its signing name from metadata.

Link to this section Summary

Link to this section Types

Specs

t() :: %AWS.Client{
  access_key_id: term(),
  endpoint: term(),
  http_client: term(),
  json_module: term(),
  port: term(),
  proto: term(),
  region: term(),
  secret_access_key: term(),
  service: term(),
  session_token: term(),
  xml_module: term()
}

Link to this section Functions

Link to this function

create(access_key_id, secret_access_key, region)

View Source
Link to this function

create(access_key_id, secret_access_key, token, region)

View Source
Link to this function

decode!(client, payload, format)

View Source
Link to this function

encode!(client, payload, format)

View Source
Link to this function

request(client, method, url, body, headers, opts \\ [])

View Source