NavigationContentFooter
Jump toSuggest an edit

Functions - Quickstart

Reviewed on 04 January 2024Published on 26 May 2021

Scaleway Serverless Functions makes your functions available, executes them on demand and manages resource allocation for you.

Functions are designed for lightweight and short-lived workloads, and are limited to a selection of runtimes for optimum performance.

Refer to the differences between Functions, Jobs, and Containers for more information on Scaleway’s different Serverless products.

This page explains how to deploy, invoke, and delete a basic Node, Python, or PHP 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 cURL installed

How to create a function

If you have no existing Serverless Functions resources in your current Project, the creation process will guide you through the creation of a namespace, and then a function.

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

  2. Click + Create a function. The function namespace creation wizard displays.

  3. Complete the following steps in the wizard:

    • Enter a name or use the automatically generated one. The name can only contain lowercase alphanumeric characters and dashes.
    • Enter an optional description.
    • Choose a region, which is the geographical location in which your namespace will be deployed.
  4. Click Create namespace and add function. The function creation wizard displays.

    Note

    Refer to the How to create a Functions namespace documentation page for more information on the different parameters.

  5. Complete the following steps in the wizard:

    • Choose either Node, Python or PHP as a runtime.
    • Select Deploy “Hello world” if you want to deploy a basic function, or select Inline code editor to enter your own function code.
    • 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.
    • Choose the smallest resources available to allocate to your function.
    • Leave the default scaling values.
    • In the Advanced options, set the Function privacy policy to public.
    • Verify the estimated cost.
    Note

    Refer to the How to create a function documentation page for more information on the different parameters.

  6. Click Create function. The deployment takes several minutes to complete. Check the Overview tab to see the function’s status.

How to test a function

  1. Click the Test tab of your function.

  2. Set the Method to GET and the Path to /.

  3. Click the Run button to start the test.

The Output section displays the response from your function and the status code.

How to delete a function

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

  2. Click the relevant functions namespace.

  3. Click the «See more Icon» icon next to the function you want to delete, and select Delete from the drop-down menu.

  4. Type DELETE in the pop-up that asks you to confirm the action, then click Delete function.

Tip

You can also delete a function from the function’s Overview tab.

Going further

If you require more advanced usage, such as large projects with dependencies, automation, and multiple functions, refer to our deployment methods documentation and check our repository for examples and use cases.

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