You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: serverless/functions/how-to/create-a-function.mdx
+42-13Lines changed: 42 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,28 +32,57 @@ This page shows you how to deploy a [function](/serverless/functions/concepts/#f
32
32
### Function configuration
33
33
34
34
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.
41
55
<Messagetype="tip">
42
56
Define a minimum of **one instance** or more to avoid cold starts.
43
57
</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.
47
66
<Messagetype="note">
48
67
Encode your environment variables and secrets to `base64` if they are too large, and contain carriage returns.
49
68
</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.
52
75
<Messagetype="note">
53
76
[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.
54
77
</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.
57
86
58
87
<Messagetype="tip">
59
88
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