ExAws.Lambda.Client behaviour

The purpose of this module is to surface the ExAws.Lambda API with a single configuration chosen, such that it does not need passed in with every request.

Usage:

defmodule MyApp.Lambda do
  use ExAws.Lambda.Client, otp_app: :my_otp_app
end

In your config

config :my_otp_app, :ex_aws,
  lambda: [], # lambda config goes here

You can now use MyApp.Lambda as the module for the Lambda api without needing to pass in a particular configuration. This enables different otp apps to configure their AWS configuration separately.

The alignment with a particular OTP app however is entirely optional. The following also works:

defmodule MyApp.Lambda do
  use ExAws.Lambda.Client

  def config_root do
    Application.get_all_env(:my_aws_config_root)
  end
end

ExAws now expects the config for that lambda client to live under

config :my_aws_config_root
  lambda: [] # Lambda config goes here

Default config values can be found in ExAws.Config

http://docs.aws.amazon.com/kinesis/latest/APIReference/API_Operations.html

Source

Types

starting_position_vals :: :trim_horizon | :latest

add_permission_opts :: [source_account: binary, source_arn: binary]

create_event_source_mapping_opts :: [batch_size: pos_integer, enabled: boolean]

create_function_opts :: [description: binary, memory_size: pos_integer, timeout: pos_integer]

invoke_opts :: [invocation_type: :event | :request_response | :dry_run, log_type: :none | :tail]

list_event_source_mappings_opts :: [event_source_arn: binary, function_name: binary, marker: binary, max_items: pos_integer]

list_functions_opts :: [marker: binary, max_items: pos_integer]

Callbacks

add_permission/4

Specs:

  • add_permission(function_name :: binary, principal :: binary, action :: binary, statement_id :: binary) :: ExAws.Request.response_t

Adds a permission to the access policy associated with the specified AWS Lambda function

Action pattern: (lambda:[*]|lambda:[a-zA-Z]+|[*])

Source
add_permission/5

Specs:

  • add_permission(function_name :: binary, principal :: binary, action :: binary, statement_id :: binary, opts :: add_permission_opts) :: ExAws.Request.response_t
Source
config_root/0

Specs:

Retrieves the root AWS config for this client

Source
create_event_source_mapping/3

Specs:

  • create_event_source_mapping(function_name :: binary, event_source_arn :: binary, starting_position :: starting_position_vals) :: ExAws.Request.response_t

Creates a stream based event source for a function

Source
create_event_source_mapping/4

Specs:

Source
create_function/3

Specs:

  • create_function(function_name :: binary, handler :: binary, zipfile :: binary) :: ExAws.Request.response_t

Create a function.

Runtime defaults to nodejs, as that is the only one available.

Source
create_function/4

Specs:

  • create_function(function_name :: binary, handler :: binary, zipfile :: binary, opts :: create_function_opts) :: ExAws.Request.response_t
Source
delete_event_source_mapping/1

Specs:

  • delete_event_source_mapping(source_mapping_uuid :: binary) :: ExAws.Request.response_t

Delete an event source mapping

Source
delete_function/1

Specs:

  • delete_function(function_name :: binary) :: ExAws.Request.response_t

Delete a lambda function

Source
get_event_source_mapping/1

Specs:

  • get_event_source_mapping(source_mapping_uuid :: binary) :: ExAws.Request.response_t

Get an event source mapping

Source
get_function/1

Specs:

  • get_function(function_name :: binary) :: ExAws.Request.response_t

Get a function

Source
get_function_configuration/1

Specs:

  • get_function_configuration(function_name :: binary) :: ExAws.Request.response_t

Get a function configuration

Source
get_policy/1

Specs:

  • get_policy(function_name :: binary) :: ExAws.Request.response_t

Get a function access policy

Source
invoke/3

Specs:

  • invoke(function_name :: binary, payload :: %{}, client_context :: %{}) :: ExAws.Request.response_t

Invoke a lambda function

Source
invoke/4

Specs:

  • invoke(function_name :: binary, payload :: %{}, client_context :: %{}, opts :: invoke_opts) :: ExAws.Request.response_t
Source
invoke_async/2

Specs:

  • invoke_async(function_name :: binary, args :: %{}) :: ExAws.Request.response_t

Invoke a lambda function asynchronously

Source
list_event_source_mappings/0

Specs:

  • list_event_source_mappings :: term

List event source mappings

Source
list_event_source_mappings/1

Specs:

Source
list_functions/0

Specs:

  • list_functions :: ExAws.Request.response_t

List functions

Source
list_functions/1

Specs:

Source
remove_permission/2

Specs:

  • remove_permission(function_name :: binary, statement_id :: binary) :: ExAws.Request.response_t

Remove individual permissions from an function’s access policy

Source
request/4

Specs:

  • request(client :: %{}, data :: %{}, action :: atom, path :: binary) :: term

Enables custom request handling.

By default this just forwards the request to the ExAws.Lambda.Request.request/4. However, this can be overriden in your client to provide pre-request adjustments to headers, params, etc.

Source
request/5

Specs:

  • request(client :: %{}, data :: %{}, action :: atom, path :: binary, params :: Dict.t) :: term
Source
request/6

Specs:

  • request(client :: %{}, data :: %{}, action :: atom, path :: binary, params :: Dict.t, headers :: [{binary, binary}, ...]) :: term
Source
update_event_source_mapping/2

Specs:

  • update_event_source_mapping(uuid :: binary, attrs_to_update :: %{}) :: ExAws.Request.response_t

Update event source mapping

Source
update_function_code/2

Specs:

  • update_function_code(function_name :: binary, zipfile :: binary) :: ExAws.Request.response_t

Update function code

Source
update_function_configuration/2

Specs:

  • update_function_configuration(function_name :: binary, configuration :: %{}) :: ExAws.Request.response_t

Update a function configuration

Source