ExAws v0.4.19 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

Summary

Callbacks

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

Retrieves the root AWS config for this client

Creates a stream based event source for a function

Delete an event source mapping

Delete a lambda function

Get an event source mapping

Get a function configuration

Get a function access policy

Invoke a lambda function asynchronously

List event source mappings

List functions

Remove individual permissions from an function’s access policy

Enables custom request handling

Types

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, qualifier: String.t]
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]
starting_position_vals :: :trim_horizon | :latest

Callbacks

add_permission(function_name, principal, action, statement_id)

Specs

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

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

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

add_permission(function_name, principal, action, statement_id, opts)

Specs

add_permission(function_name :: binary, principal :: binary, action :: binary, statement_id :: binary, opts :: add_permission_opts) :: ExAws.Lambda.Request.response_t
config_root()

Specs

config_root :: Keyword.t

Retrieves the root AWS config for this client

create_event_source_mapping(function_name, event_source_arn, starting_position)

Specs

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

Creates a stream based event source for a function

create_event_source_mapping(function_name, event_source_arn, starting_position, opts)

Specs

create_event_source_mapping(function_name :: binary, event_source_arn :: binary, starting_position :: starting_position_vals, opts :: create_event_source_mapping_opts) :: ExAws.Lambda.Request.response_t
create_function(function_name, handler, zipfile)

Specs

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

Create a function.

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

create_function(function_name, handler, zipfile, opts)

Specs

create_function(function_name :: binary, handler :: binary, zipfile :: binary, opts :: create_function_opts) :: ExAws.Lambda.Request.response_t
delete_event_source_mapping(source_mapping_uuid)

Specs

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

Delete an event source mapping

delete_function(function_name)

Specs

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

Delete a lambda function

get_event_source_mapping(source_mapping_uuid)

Specs

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

Get an event source mapping

get_function(function_name)

Specs

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

Get a function

get_function_configuration(function_name)

Specs

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

Get a function configuration

get_policy(function_name)

Specs

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

Get a function access policy

invoke(function_name, payload, client_context)

Specs

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

Invoke a lambda function

invoke(function_name, payload, client_context, opts)

Specs

invoke(function_name :: binary, payload :: %{}, client_context :: %{}, opts :: invoke_opts) :: ExAws.Lambda.Request.response_t
invoke_async(function_name, args)

Specs

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

Invoke a lambda function asynchronously

list_event_source_mappings()

Specs

list_event_source_mappings :: term

List event source mappings

list_event_source_mappings(opts)

Specs

list_event_source_mappings(opts :: list_event_source_mappings_opts) :: ExAws.Lambda.Request.response_t
list_functions()

Specs

list_functions :: ExAws.Lambda.Request.response_t

List functions

list_functions(opts)

Specs

list_functions(opts :: list_functions_opts) :: ExAws.Lambda.Request.response_t
remove_permission(function_name, statement_id)

Specs

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

Remove individual permissions from an function’s access policy

request(client, data, action, path)

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.

request(client, data, action, path, params)

Specs

request(client :: %{}, data :: %{}, action :: atom, path :: binary, params :: Dict.t) :: term
request(client, data, action, path, params, headers)

Specs

request(client :: %{}, data :: %{}, action :: atom, path :: binary, params :: Dict.t, headers :: [{binary, binary}, ...]) :: term
update_event_source_mapping(uuid, attrs_to_update)

Specs

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

Update event source mapping

update_function_code(function_name, zipfile)

Specs

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

Update function code

update_function_configuration(function_name, configuration)

Specs

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

Update a function configuration