NavigationContentFooter
Suggest an edit

How to create a function

Reviewed on 08 January 2024Published on 26 May 2021

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

Before you start

To complete the actions presented on this page, you must have:

Requirements
  • You have an account and are logged into the Scaleway console
  • You have created a functions namespace
  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.

  4. Complete the following steps in the wizard:

    • Choose your function’s runtime.
    • Select Deploy “Hello world” to deploy a basic function, Inline code editor to enter your own function code, or Upload a ZIP to import a packaged function.
    • If you used the code editor, enter the handler of your function.
    • Enter a name or use the automatically generated one. The name can only contain lowercase alphanumeric characters and dashes.
    • Enter an optional description.
    • Select the resources to allocate to your function.
    • Configure the scaling of your function.
    Tip

    Define a minimum of one instance or more to avoid cold starts.

  5. Click + Advanced options and complete the following steps:

    • Define any environment variables you want to inject into your function. For each environment variable, click + Add variable and enter the key/value pair.
    • Optionally, set secret environment variables. Secrets are environment variables which are injected into your function and stored securely, but not displayed in the console after initial validation. Add a key and a value.
    • 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).
    • Set the desired timeout for your function.
    Note

    Triggers can no longer be added from this screen. For more information, refer to the How to add a trigger to a function documentation.

    • Verify the estimated cost.
  6. Click Create function to finish.

Tip

There are different ways to deploy Serverless Functions. Refer to our detailed deployment information for more advanced options to deploy your functions.

See also
How to manage a Serverless Functions namespaceHow to test a Serverless Function
Cloud Products & Resources
  • Scaleway Console
  • Compute
  • Storage
  • Network
  • IoT
  • AI
Dedicated Products & Resources
  • Dedibox Console
  • Dedibox Servers
  • Network
  • Web Hosting
Scaleway
  • Scaleway.com
  • Blog
  • Careers
  • Scaleway Learning
Follow us
FacebookTwitterSlackInstagramLinkedin
ContractsLegal NoticePrivacy PolicyCookie PolicyDocumentation license
© 1999-2024 – Scaleway SAS