# Functions

Functions are defined inside the `api.functions` table within the service manifest.

```
[api.functions.function-id]
# The function name is required
name = "myfunction"

# The `http` param defines an HTTP API entry for the function
# `verb` is an HTTP verb such as GET or POST
# Path parameters are denoted inside curly braces "{}"
http = { verb = "GET", path = "/path/maybe/with/{parameter}" }

# The authorizer id refers to an authorizer defined in the same service
authorizer_id = "<id>"

# The timeout in seconds after which the function is terminated, regardless of whether it has completed.
timeout_seconds = 3

# The size of the function in MB. AWS Lambda scales the CPU allocation with this value.
size_mb = 512
```

The `authorizer_id` refers to the table ID within the service manifest of the authorizer you wish to attach.

```
[api.authorizers.my-auth]
type = "iam"

[api.functions.my-func]
authorizer_id = "my-auth"
```

Please see the next section on [Authorizers](/learn-assemblylift/services/authorizers.md) for further details.

## HTTP Functions

The default API provider is Amazon API Gateway. Each service has a corresponding gateway endpoint, and specifying an HTTP verb and path for your function will create the corresponding routes & integrations. You can view details such as the generated API URL in your AWS Console.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.assemblylift.akkoro.io/learn-assemblylift/services/functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
