Define a minimum of one instance or more to avoid cold starts.
How to create a function using the Scaleway console
This page shows you how to deploy a function using the Scaleway console.
Before you startLink to this anchor
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A functions namespace
How to create a functionLink to this anchor
-
Click Functions in the Serverless section of the side menu. The functions page displays.
-
Click the functions namespace in which you want to create your function.
-
Click + Create function. The function creation wizard displays.
Function configurationLink to this anchor
-
Select a runtime for your function. For more information on runtimes configuration and lifecycle, refer to the dedicated documentation.
-
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.
-
-
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. You can click the icon at the right to generate a random name for your function.
-
Enter an optional description for your function.
Function resources and scalingLink to this anchor
-
Select the resources to allocate to your function.
-
Configure the scaling of your function.
Tip
Function advanced optionsLink to this anchor
In the Advanced options section, set the following:
- Declare environment variables you want to inject into your function. For each environment variable, click +Add variable and enter the key/value pair.
- Declare secrets for your function. Secrets are environment variables that are injected into your function, but the values are not retained or displayed by Scaleway after initial validation.
Note
Encode your environment variables and secrets to
base64
if they are too large, and contain carriage returns.
- Set the desired privacy policy for your function. This defines whether function invocation may be done anonymously (public) or only via an authentication mechanism provided by the Scaleway API (private).
- Tick the box under HTTPS connections only to prevent your function from being called from insecure HTTP connections. All HTTP traffic will be redirected to HTTPS.
- Set a custom timeout for the duration of the requests received by your function.
- Select a sandbox version:
- Sandbox v2 for shorter cold starts (recommended).
- Sandbox v1 if you require full compatibility with the Linux system call interface (legacy).
Function cost and validationLink to this anchor
-
Update the Number of requests and Average request duration fields to simulate the behavior of your function.
-
Verify the estimated cost. Refer to the Serverless Functions pricing for more information on how billing works.
-
Click Create function to finish.
There are different ways to deploy Serverless Functions. Refer to our detailed deployment information for more advanced options to deploy your functions.