Functions - Quickstart
Scaleway’s Serverless Functions platform makes your functions available, executes them on demand and manages resource allocation for you.
This page explains how to deploy, invoke and delete a basic Node, Python, or PHP function using the Scaleway console. For advanced usage, such as larger projects with dependencies, automation, multiple functions and more, many ways to deploy functions are available.
Check out our scaleway/serverless-examples repository for advanced examples and use cases.
You may need certain IAM permissions to carry out some actions described on this page. This means:
- you are the Owner of the Scaleway Organization in which the actions will be carried out, or
- you are an IAM user of the Organization, with a policy granting you the necessary permission sets
- 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.
-
Click Functions in the Serverless section of the side menu. The functions page displays.
-
Click + Create a function. The function namespace creation wizard displays.
-
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 a description (optional).
- Choose a region, which is the geographical location in which your namespace will be deployed.
-
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.
-
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 a description (optional).
- 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.
-
Click Create function. The deployment takes several minutes to complete. Check the Overview tab to see the function’s status.
-
Copy the function’s endpoint URL from the Overview tab.
-
Run the following command in your terminal to invoke your function once it is deployed:
curl <YOUR_FUNCTION_ENDPOINT>
How to delete a function
-
Click Functions in the Serverless section of the side menu. The functions page displays.
-
Click the relevant functions namespace.
-
Click the «See more Icon» icon next to the function you want to delete, and select Delete from the drop-down menu.
-
Type DELETE in the pop-up that asks you to confirm the action, then click Delete function.
You can also delete a function from the Function settings tab.