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, ExAws,
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
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
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]+|[*])
Specs:
- add_permission(function_name :: binary, principal :: binary, action :: binary, statement_id :: binary, opts :: add_permission_opts) :: ExAws.Request.response_t
Specs:
- config_root :: Keyword.t
Retrieves the root AWS config for this client
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
Specs:
- create_event_source_mapping(function_name :: binary, event_source_arn :: binary, starting_position :: starting_position_vals, opts :: create_event_source_mapping_opts) :: ExAws.Request.response_t
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.
Specs:
- create_function(function_name :: binary, handler :: binary, zipfile :: binary, opts :: create_function_opts) :: ExAws.Request.response_t
Specs:
- delete_event_source_mapping(source_mapping_uuid :: binary) :: ExAws.Request.response_t
Delete an event source mapping
Specs:
- delete_function(function_name :: binary) :: ExAws.Request.response_t
Delete a lambda function
Specs:
- get_event_source_mapping(source_mapping_uuid :: binary) :: ExAws.Request.response_t
Get an event source mapping
Specs:
- get_function(function_name :: binary) :: ExAws.Request.response_t
Get a function
Specs:
- get_function_configuration(function_name :: binary) :: ExAws.Request.response_t
Get a function configuration
Specs:
- get_policy(function_name :: binary) :: ExAws.Request.response_t
Get a function access policy
Specs:
- invoke(function_name :: binary, payload :: %{}, client_context :: %{}) :: ExAws.Request.response_t
Invoke a lambda function
Specs:
- invoke(function_name :: binary, payload :: %{}, client_context :: %{}, opts :: invoke_opts) :: ExAws.Request.response_t
Specs:
- invoke_async(function_name :: binary, args :: %{}) :: ExAws.Request.response_t
Invoke a lambda function asynchronously
Specs:
- list_event_source_mappings :: term
List event source mappings
Specs:
- list_event_source_mappings(opts :: list_event_source_mappings_opts) :: ExAws.Request.response_t
Specs:
- list_functions :: ExAws.Request.response_t
List functions
Specs:
- list_functions(opts :: list_functions_opts) :: ExAws.Request.response_t
Specs:
- remove_permission(function_name :: binary, statement_id :: binary) :: ExAws.Request.response_t
Remove individual permissions from an function’s access policy
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.
Specs:
- request(client :: %{}, data :: %{}, action :: atom, path :: binary, params :: Dict.t) :: term
Specs:
- request(client :: %{}, data :: %{}, action :: atom, path :: binary, params :: Dict.t, headers :: [{binary, binary}, ...]) :: term
Specs:
- update_event_source_mapping(uuid :: binary, attrs_to_update :: %{}) :: ExAws.Request.response_t
Update event source mapping
Specs:
- update_function_code(function_name :: binary, zipfile :: binary) :: ExAws.Request.response_t
Update function code
Specs:
- update_function_configuration(function_name :: binary, configuration :: %{}) :: ExAws.Request.response_t
Update a function configuration