Pardon our mess! We are busy building up docs for our beta users.

Contact us if you need any help getting started, or have any questions at [email protected]

Functions

Serverless applications are sometimes referred to as Functions as a Service. This is because functions are the heart and soul of serverless architectures.

Overview

Functions are the foundation of your service because they allow your app to respond to an event. For example, an HTTP request is an event that can be processed by a function, and the output of that function would be the HTTP response back to the user.

Functions must be declared in your config file so that AWS Lambda is aware of them. Any function defined in this file may be referenced in other sections.

Config

The functions map is an object, where the map key is the reference for the function, and the map object defines its configuration.

Example:

functions:
	test_function_1:
		name: My Example Function
		handler: my_file.test_function_1
	my_other_function:
		name: Another Function
		handler: my_file.another_function

Name

This parameter allows you to specify a friendly name for the function. If not specified, the function reference key will be used instead.

Handler

AWS Lambda requires a function entry point in order to execute your function. This field specifies the file name (minus the extension) plus the name of the function in that file.

For example, using the Node.js runtime, the handler some/directory/path/my_file.my_function refers to a function named my_function which lives in a file named my_file inside the directory structure some/directory/path. Note that the directory path is relative to the project/repository root.

For more information about writing functions and specifying a handler, refer to the AWS Lambda Guide.

Timeout

You may specify a maximum function timeout for this function. If a timeout was also set at the config root, this will take precedence.

See the timeout section for a description of the value.

Memory

You may specify a memory limit for this function. If a memory limit was also set at the config root, this will take precedence.

See the memory section for a description of the value.

Role

You may specify an AWS IAM role for this function. If a role was also set at the config root, this will take precedence.

See the role section for a description of the value.