Skip to content

Latest commit

 

History

History
90 lines (58 loc) · 4.42 KB

create-a-function.mdx

File metadata and controls

90 lines (58 loc) · 4.42 KB
meta content tags dates categories
title description
How to create a function using the Scaleway console
Create your first serverless function on Scaleway with this comprehensive guide.
h1 paragraph
How to create a function using the Scaleway console
Create your first serverless function on Scaleway with this comprehensive guide.
functions
validation posted
2025-01-29
2021-05-26
serverless

This page shows you how to deploy a function using the Scaleway console.

How to create a function

  1. Click Functions in the Serverless section of the side menu. The functions page displays.

  2. Click the functions namespace in which you want to create your function.

  3. Click + Create function. The function creation wizard displays.

Function configuration

  1. Select a runtime for your function. For more information on runtimes configuration and lifecycle, refer to the dedicated documentation.

  2. Select a function code option:

    • Inline code editor to enter your own function code.

    • Deploy "Hello world" to deploy a basic function that will return "Hello world" when invoked. This option allows you to quickly test a deployment.

    • Upload a ZIP to import a packaged function.

  3. If you used the code editor, enter the handler of your function.

  4. Enter a name or use the automatically generated one. The name can only contain lowercase alphanumeric characters and dashes. You can click the icon at the right to generate a random name for your function.

  5. Enter an optional description for your function.

Function resources and scaling

  1. Select the resources to allocate to your function.

  2. Configure the scaling of your function. Define a minimum of one instance or more to avoid cold starts.

Function advanced options (optional)

  1. Click + Advanced options.

  2. Define any environment variables you want to inject into your function. For each environment variable, click + Add variable and enter the key/value pair.

  3. Define any Secrets you want to inject into your function. For each secret, click + Add secret and enter the key/value pair. Secrets are environment variables which are injected into your function and stored securely, but not displayed in the console after initial validation.

    Encode your environment variables and secrets to `base64` if they are too large, and contain carriage returns.
  4. Set the desired privacy policy for your function. This defines whether a function can be executed anonymously (public) or only via an authentication mechanism provided by the Scaleway API (private).

  5. Set the desired timeout for your function.

  6. Choose the desired Sandbox environment for your function. Triggers can no longer be added from this screen. For more information, refer to the How to add a trigger to a function documentation.

Function cost and validation

  1. Update the Number of requests and Average request duration fields to simulate the behavior of your function.

  2. Verify the estimated cost. Refer to the Serverless Functions pricing for more information on how billing works.

  3. Click Create function to finish.

There are different ways to deploy Serverless Functions. Refer to our detailed [deployment information](/serverless-functions/reference-content/deploy-function/) for more advanced options to deploy your functions.