How To Design Lambda functions?

The following are the general design principles for designing AWS Lambda functions.
Your function should be concise, short, simple, single-purpose, and follows Single-Responsibility-Principle.
Your function should not have internal branching logic, which makes them monolithic, and harder to change, and maintain.
Function runtime environment and underlying infrastructure are short-lived, therefore local resources such as temporary storage are not guaranteed.
The state can be manipulated within a state machine execution lifecycle.
Persistent storage is preferred for highly durable requirements.
Operations triggered from requests/events must be idempotent as failures can occur and a given request/event can be delivered more than once. Include appropriate retries for downstream calls.