Skip to content

Commit 473e4ad

Browse files
committed
docs(srv): update
1 parent 5c5dd67 commit 473e4ad

File tree

1 file changed

+42
-13
lines changed

1 file changed

+42
-13
lines changed

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

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,57 @@ This page shows you how to deploy a [function](/serverless-functions/concepts/#f
3232
### Function configuration
3333

3434
1. Select a runtime for your function.
35-
- 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/).
36-
- If you used the code editor, enter the [handler](/serverless-functions/reference-content/functions-handlers/) of your function.
37-
- Enter a **name** or use the automatically generated one. The name can only contain lowercase alphanumeric characters and dashes.
38-
- Enter an optional **description**.
39-
- Select the **resources** to allocate to your function.
40-
- Configure the **scaling** of your function.
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.
4155
<Message type="tip">
4256
Define a minimum of **one instance** or more to avoid cold starts.
4357
</Message>
44-
5. Click **+ Advanced options** and complete the following steps:
45-
- Define any **environment variables** you want to inject into your function. For each environment variable, click **+ Add variable** and enter the key/value pair.
46-
- 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**.
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.
4766
<Message type="note">
4867
Encode your environment variables and secrets to `base64` if they are too large, and contain carriage returns.
4968
</Message>
50-
- 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**).
51-
- Set the desired timeout for your function.
69+
70+
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**).
71+
72+
5. Set the desired timeout for your function.
73+
74+
6. Choose the desired **Sandbox** environment for your function.
5275
<Message type="note">
5376
[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.
5477
</Message>
55-
- Verify the **estimated cost**.
56-
6. Click **Create function** to finish.
78+
79+
### Function cost and validation
80+
81+
1. Update the **Number of requests** and **Average request duration** fields to simulate the behavior of your function.
82+
83+
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.
84+
85+
3. Click **Create function** to finish.
5786

5887
<Message type="tip">
5988
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.

0 commit comments

Comments
 (0)