Skip to content

Commit da69b2a

Browse files
SamyOubouazizLaure-di
authored andcommitted
docs(srv): update how to create function and reorg pages MTA-5477 (scaleway#4233)
* docs(srv): update how to create function and reorg pages MTA-5477 * docs(srv): update * docs(srv): update * docs(srv): update
1 parent 5c6b0e0 commit da69b2a

12 files changed

+129
-46
lines changed

changelog/serverless/january2023/2023-01-11-added-functions-php-extensions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ category: serverless
99
product: functions
1010
---
1111

12-
The PHP Runtime for Serverless Functions now supports [more extensions](/serverless-functions/reference-content/functions-runtimes-configuration/).
12+
The PHP Runtime for Serverless Functions now supports [more extensions](/serverless-functions/reference-content/functions-runtimes/).

changelog/serverless/september2022/2022-09-08-functions-changed-nodejs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ product: functions
1212
NodeJS 18 is now in general availability.
1313

1414

15-
For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-lifecycle/).
15+
For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-runtimes/).

changelog/serverless/september2022/2022-09-08-functions-deprecated-go.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ product: functions
1111

1212
- Golang and Go113 will reach end of support. We recommend you update to go1.17 or a newer version.
1313

14-
For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-lifecycle/).
14+
For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-runtimes/).

changelog/serverless/september2022/2022-09-08-functions-deprecated-nodejs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ product: functions
1212
- NodeJS 8 and NodeJS 10 will reach end of support. We recommend you update to Node 14 or a newer node version.
1313
- NodeJS 17 will reach end of support. We recommend you update to NodeJS 18.
1414

15-
For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-lifecycle/).
15+
For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-runtimes/).

changelog/serverless/september2022/2022-09-08-functions-deprecated-python.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ product: functions
1212
- Python and Python 2.7 will reach end of support. We recommend you update to a newer version of Python.
1313
- Python 3 will reach end of support. We recommend you update to Python 3.7.
1414

15-
For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-lifecycle/).
15+
For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-runtimes/).

faq/serverless-functions.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Refer to our dedicated page about [Serverless Functions limitations and configur
173173

174174
Serverless Functions enables you to deploy functions using popular languages: `Go`, `Node`, `Python`, `PHP`, and `Rust`.
175175

176-
Refer to our dedicated page about [Serverless Functions Runtimes Lifecycle](/serverless-functions/reference-content/functions-lifecycle/)
176+
Refer to our dedicated page about [Serverless Functions Runtimes Lifecycle](/serverless-functions/reference-content/functions-runtimes/)
177177

178178
### Why does my function have an instance running after deployment, even with min-scale 0?
179179

@@ -210,7 +210,7 @@ Check out our [serverless-examples repository](https://github.com/scaleway/serve
210210
### How to migrate runtimes?
211211

212212
There are no constraints when changing a function runtime, you simply need to choose the runtime version you want.
213-
Upgrading a runtime is highly recommended in case of deprecation, and for runtimes that have reached end-of-support or end-of-life. See the [functions runtimes lifecycle documentation](/serverless-functions/reference-content/functions-lifecycle/) for more information.
213+
Upgrading a runtime is highly recommended in case of deprecation, and for runtimes that have reached end-of-support or end-of-life. See the [functions runtimes lifecycle documentation](/serverless-functions/reference-content/functions-runtimes/) for more information.
214214

215215
## Network and storage
216216

macros/serverless/difference-jobs-functions-containers.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Choose Scaleway [Serverless Functions](/serverless-functions/quickstart/):
5858
- For stateless workloads.
5959

6060
<Message type="note">
61-
Serverless Functions can only be written in languages [available as runtimes](/serverless-functions/reference-content/functions-lifecycle/#available-runtimes).
61+
Serverless Functions can only be written in languages [available as runtimes](/serverless-functions/reference-content/functions-runtimes/#available-runtimes).
6262
</Message>
6363

6464
### Serverless Containers

menu/navigation.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3747,17 +3747,13 @@
37473747
{
37483748
"items": [
37493749
{
3750-
"label": "Functions lifecycle",
3751-
"slug": "functions-lifecycle"
3750+
"label": "Functions runtimes",
3751+
"slug": "functions-runtimes"
37523752
},
37533753
{
37543754
"label": "Functions limitations",
37553755
"slug": "functions-limitations"
37563756
},
3757-
{
3758-
"label": "Functions runtimes configuration",
3759-
"slug": "functions-runtimes-configuration"
3760-
},
37613757
{
37623758
"label": "Methods to deploy Serverless Functions",
37633759
"slug": "deploy-function"

pages/serverless-functions/api-cli/deploy-function-cli.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ categories:
7676
```
7777

7878
<Message type="tip">
79-
Refer to [this page](/serverless-functions/reference-content/functions-lifecycle/#available-runtimes) to see all the available runtimes.
79+
Refer to [this page](/serverless-functions/reference-content/functions-runtimes/#available-runtimes) to see all the available runtimes.
8080
</Message>
8181

8282
3. Create a zip file containing your function's code by following [this procedure](/serverless-functions/how-to/package-function-dependencies-in-zip/).

pages/serverless-functions/how-to/create-a-function.mdx

Lines changed: 55 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
meta:
3-
title: How to create a function
3+
title: How to create a function using the Scaleway console
44
description: Create your first serverless function on Scaleway with this comprehensive guide.
55
content:
6-
h1: How to create a function
6+
h1: How to create a function using the Scaleway console
77
paragraph: Create your first serverless function on Scaleway with this comprehensive guide.
88
tags: functions
99
dates:
10-
validation: 2024-07-23
10+
validation: 2025-01-29
1111
posted: 2021-05-26
1212
categories:
1313
- serverless
@@ -21,39 +21,70 @@ This page shows you how to deploy a [function](/serverless-functions/concepts/#f
2121
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
2222
- A [functions namespace](/serverless-functions/how-to/create-manage-delete-functions-namespace/)
2323

24+
## How to create a function
25+
2426
1. Click **Functions** in the **Serverless** section of the side menu. The functions page displays.
2527

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

2830
3. Click **+ Create function**. The function creation wizard displays.
2931

30-
4. Complete the following steps in the wizard:
31-
- Choose your function's runtime.
32-
- 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](/serverless-functions/how-to/package-function-dependencies-in-zip/).
33-
- If you used the code editor, enter the [handler](/serverless-functions/reference-content/functions-handlers/) of your function.
34-
- Enter a **name** or use the automatically generated one. The name can only contain lowercase alphanumeric characters and dashes.
35-
- Enter an optional **description**.
36-
- Select the **resources** to allocate to your function.
37-
- Configure the **scaling** of your function.
32+
### Function configuration
33+
34+
1. Select a runtime for your function. For more information on runtimes configuration and lifecycle, refer to the [dedicated documentation](/serverless/functions/reference-content/functions-runtimes/).
35+
36+
2. Select a function code option:
37+
38+
- **Inline code editor** to enter your own function code.
39+
40+
- **Deploy "Hello world"** to deploy a basic function that will return "Hello world" when invoked. This option allows you to quickly test a deployment.
41+
42+
- **Upload a ZIP** to import a [packaged function](/serverless-functions/how-to/package-function-dependencies-in-zip/).
43+
44+
3. If you used the code editor, enter the [handler](/serverless-functions/reference-content/functions-handlers/) of your function.
45+
46+
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.
47+
48+
5. Enter an optional **description** for your function.
49+
50+
### Function resources and scaling
51+
52+
1. Select the **resources** to allocate to your function.
53+
54+
2. Configure the **scaling** of your function.
3855
<Message type="tip">
39-
Define a minimum of **one instance** or more to avoid cold starts.
56+
Define a minimum of **one instance** or more to avoid [cold starts](/serverless/functions/concepts/#cold-start).
4057
</Message>
41-
5. Click **+ Advanced options** and complete the following steps:
42-
- Define any **environment variables** you want to inject into your function. For each environment variable, click **+ Add variable** and enter the key/value pair.
43-
- 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**.
44-
<Message type="note">
45-
Encode your environment variables and secrets to `base64` if they are too large, and contain carriage returns.
46-
</Message>
47-
- 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](https://www.scaleway.com/en/developers/api/serverless-functions/#authentication) (**private**).
48-
- Set the desired timeout for your function.
58+
59+
### Function advanced options (optional)
60+
61+
1. Click **+ Advanced options**.
62+
63+
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.
64+
65+
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.
66+
67+
<Message type="note">
68+
Encode your environment variables and secrets to `base64` if they are too large, and contain carriage returns.
69+
</Message>
70+
71+
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](https://www.scaleway.com/en/developers/api/serverless-functions/#authentication) (**private**).
72+
73+
5. Set the desired timeout for your function.
74+
75+
6. Choose the desired **Sandbox** environment for your function.
4976
<Message type="note">
5077
[Triggers](/serverless-functions/concepts/#trigger) can no longer be added from this screen. For more information, refer to the [How to add a trigger to a function](/serverless-functions/how-to/add-trigger-to-a-function/) documentation.
5178
</Message>
52-
- Verify the **estimated cost**.
53-
6. Click **Create function** to finish.
79+
80+
### Function cost and validation
81+
82+
1. Update the **Number of requests** and **Average request duration** fields to simulate the behavior of your function.
83+
84+
2. Verify the **estimated cost**. Refer to the [Serverless Functions pricing](/faq/serverless-functions/#how-am-i-billed-for-serverless-functions) for more information on how billing works.
85+
86+
3. Click **Create function** to finish.
5487

5588
<Message type="tip">
5689
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.
5790
</Message>
58-
59-

0 commit comments

Comments
 (0)