Creates a Lambda function. To create a function, you need a deployment package and an execution
role. The deployment package contains your function code. The execution role grants the function permission
to use AWS services such as Amazon CloudWatch Logs for log streaming and AWS X-Ray for request tracing.
A function has an unpublished version, and can have published versions and aliases. A published version is a
snapshot of your function code and configuration that can not be changed. An alias is a named resource that maps
to a version, and can be changed to map to a different version. Use the Publish
parameter to create
version 1
of your function from its initial configuration.
The other parameters let you configure version-specific and function-level settings. You can modify
version-specific settings later with UpdateFunctionConfiguration. Function-level settings apply to both
the unpublished and published versions of the function and include tags (TagResource) and per-function
concurrency limits (PutFunctionConcurrency).
If another account or a AWS service invokes your function, use AddPermission to grant permission by
creating a resource-based IAM policy. You can grant permissions at the function level, on a version, or on an
alias.
To invoke your function directly, use Invoke. To invoke your function in response to events in other AWS
services, create an event source mapping (CreateEventSourceMapping), or configure a function trigger in
the other service. For more information, see Invoking Functions.