AssemblyLift
HomeRepo
v0.3
v0.3
  • Welcome to AssemblyLift
  • Learn AssemblyLift
    • Getting Started
    • Services
      • Functions
      • Authorizers
      • IOmod Dependencies
    • Functions
      • Rust Functions
    • IO Modules
      • Registry
    • User Terraform
    • Providers
    • How to Build
    • How to Deploy
  • Development
    • Design Pillars
  • Resources
    • The Lexicon
    • Tutorial: Build a "todo list" backend with AssemblyLift
Powered by GitBook
On this page

Was this helpful?

  1. Learn AssemblyLift
  2. Services

Functions

Defining a Function within a Service

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"

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.

PreviousServicesNextAuthorizers

Last updated 3 years ago

Was this helpful?

Please see the next section on for further details.

Authorizers