Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ category: serverless
product: functions
---

The PHP Runtime for Serverless Functions now supports [more extensions](/serverless-functions/reference-content/functions-runtimes-configuration/).
The PHP Runtime for Serverless Functions now supports [more extensions](/serverless-functions/reference-content/functions-runtimes/).
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ product: functions
NodeJS 18 is now in general availability.


For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-lifecycle/).
For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-runtimes/).
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ product: functions

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

For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-lifecycle/).
For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-runtimes/).
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ product: functions
- NodeJS 8 and NodeJS 10 will reach end of support. We recommend you update to Node 14 or a newer node version.
- NodeJS 17 will reach end of support. We recommend you update to NodeJS 18.

For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-lifecycle/).
For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-runtimes/).
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ product: functions
- Python and Python 2.7 will reach end of support. We recommend you update to a newer version of Python.
- Python 3 will reach end of support. We recommend you update to Python 3.7.

For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-lifecycle/).
For more information please refer to our [dedicated documentation](/serverless-functions/reference-content/functions-runtimes/).
4 changes: 2 additions & 2 deletions faq/serverless-functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Refer to our dedicated page about [Serverless Functions limitations and configur

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

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

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

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

There are no constraints when changing a function runtime, you simply need to choose the runtime version you want.
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.
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.

## Network and storage

Expand Down
2 changes: 1 addition & 1 deletion macros/serverless/difference-jobs-functions-containers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Choose Scaleway [Serverless Functions](/serverless-functions/quickstart/):
- For stateless workloads.

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

### Serverless Containers
Expand Down
8 changes: 2 additions & 6 deletions menu/navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3735,17 +3735,13 @@
{
"items": [
{
"label": "Functions lifecycle",
"slug": "functions-lifecycle"
"label": "Functions runtimes",
"slug": "functions-runtimes"
},
{
"label": "Functions limitations",
"slug": "functions-limitations"
},
{
"label": "Functions runtimes configuration",
"slug": "functions-runtimes-configuration"
},
{
"label": "Methods to deploy Serverless Functions",
"slug": "deploy-function"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ categories:
```

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

3. Create a zip file containing your function's code by following [this procedure](/serverless-functions/how-to/package-function-dependencies-in-zip/).
Expand Down
79 changes: 55 additions & 24 deletions pages/serverless-functions/how-to/create-a-function.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
meta:
title: How to create a function
title: How to create a function using the Scaleway console
description: Create your first serverless function on Scaleway with this comprehensive guide.
content:
h1: How to create a function
h1: How to create a function using the Scaleway console
paragraph: Create your first serverless function on Scaleway with this comprehensive guide.
tags: functions
dates:
validation: 2024-07-23
validation: 2025-01-29
posted: 2021-05-26
categories:
- serverless
Expand All @@ -21,39 +21,70 @@ This page shows you how to deploy a [function](/serverless-functions/concepts/#f
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- A [functions namespace](/serverless-functions/how-to/create-manage-delete-functions-namespace/)

## How to create a function

1. Click **Functions** in the **Serverless** section of the side menu. The functions page displays.

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

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

4. Complete the following steps in the wizard:
- Choose your function's runtime.
- 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/).
- If you used the code editor, enter the [handler](/serverless-functions/reference-content/functions-handlers/) of your function.
- Enter a **name** or use the automatically generated one. The name can only contain lowercase alphanumeric characters and dashes.
- Enter an optional **description**.
- Select the **resources** to allocate to your function.
- Configure the **scaling** of your function.
### Function configuration

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/).

2. 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](/serverless-functions/how-to/package-function-dependencies-in-zip/).

3. If you used the code editor, enter the [handler](/serverless-functions/reference-content/functions-handlers/) of your function.

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.

5. Enter an optional **description** for your function.

### Function resources and scaling

1. Select the **resources** to allocate to your function.

2. Configure the **scaling** of your function.
<Message type="tip">
Define a minimum of **one instance** or more to avoid cold starts.
Define a minimum of **one instance** or more to avoid [cold starts](/serverless/functions/concepts/#cold-start).
</Message>
5. Click **+ Advanced options** and complete the following steps:
- Define any **environment variables** you want to inject into your function. For each environment variable, click **+ Add variable** and enter the key/value pair.
- 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**.
<Message type="note">
Encode your environment variables and secrets to `base64` if they are too large, and contain carriage returns.
</Message>
- 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**).
- Set the desired timeout for your function.

### Function advanced options (optional)

1. Click **+ Advanced options**.

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.

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.

<Message type="note">
Encode your environment variables and secrets to `base64` if they are too large, and contain carriage returns.
</Message>

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**).

5. Set the desired timeout for your function.

6. Choose the desired **Sandbox** environment for your function.
<Message type="note">
[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.
</Message>
- Verify the **estimated cost**.
6. Click **Create function** to finish.

### Function cost and validation

1. Update the **Number of requests** and **Average request duration** fields to simulate the behavior of your function.

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.

3. Click **Create function** to finish.

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


2 changes: 1 addition & 1 deletion pages/serverless-functions/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ categories:

Scaleway Serverless Functions makes your [functions](/serverless-functions/concepts/#function) available, executes them on demand and manages resource allocation for you.

Functions are designed for lightweight and short-lived workloads, and are limited to [a selection of runtimes](/serverless-functions/reference-content/functions-lifecycle/#available-runtimes) for optimum performance.
Functions are designed for lightweight and short-lived workloads, and are limited to [a selection of runtimes](/serverless-functions/reference-content/functions-runtimes/#available-runtimes) for optimum performance.

Refer to the [differences between Functions, Jobs, and Containers](/serverless-containers/reference-content/difference-jobs-functions-containers/) for more information on Scaleway's different Serverless products.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
meta:
title: Functions lifecycle
description: Understand the lifecycle of Serverless Functions on Scaleway, from creation to deletion.
title: Functions runtimes
description: Understand Serverless Functions runtimes on Scaleway, from creation to deletion.
content:
h1: Functions lifecycle
paragraph: Understand the lifecycle of Serverless Functions on Scaleway, from creation to deletion.
tags: functions lifecycle
h1: Functions runtimes
paragraph: Understand Serverless Functions runtimes on Scaleway, from creation to deletion.
tags: functions lifecycle runtimes
dates:
validation: 2024-07-23
validation: 2025-01-16
posted: 2022-04-13
categories:
- serverless
Expand Down Expand Up @@ -97,3 +97,59 @@ Once a function is in a `deprecated`, `end_of_support`, or `end_of_life` status,
|-----------------------|----------------|--------------|
| Rust 1.65 (`rust165`) | End of Support | |
| Rust 1.79 (`rust179`) | Available | |

## Runtimes additional information

This page contains useful information on how Serverless Functions runtimes are built and which extensions/libraries/dependencies are loaded for each of them.

### PHP

#### PHP 8.2 runtime configuration

| Parameter | Value |
|-----------------------|-------|
| `upload_max_filesize` | 2M |
| `post_max_size` | 8M |
| `max_execution_time` | 0 |
| `log_errors` | Off |
| `file_uploads{}` | On |

#### PHP 8.2 supported extensions

Supported PHP extensions for the [PHP 8.2](https://www.php.net/ChangeLog-8.php#8.2.0) runtime

| PHP extensions | | | | | | | |
| -------------- | - | -------------- | - | -------------- | - | -------------- | - |
| amqp | ✓ | apcu | ✓ | ast | ✓ | bcmath | ✓ |
| bz2 | ✓ | calendar | ✓ | Core | ✓ | csv | ✓ |
| ctype | ✓ | curl | ✓ | date | ✓ | dba | ✓ |
| ddtrace | ✓ | decimal | ✓ | dom | ✓ | ds | ✓ |
| enchant | ✓ | ev | ✓ | event | ✓ | excimer | ✓ |
| exif | ✓ | FFI | ✓ | fileinfo | ✓ | filter | ✓ |
| ftp | ✓ | gd | ✓ | geospatial | ✓ | gettext | ✓ |
| gmp | ✓ | gnupg | ✓ | grpc | ✓ | hash | ✓ |
| http | ✓ | iconv | ✓ | igbinary | ✓ | imagick | ✓ |
| imap | ✓ | inotify | ✓ | intl | ✓ | ion | ✓ |
| json | ✓ | json_post | ✓ | ldap | ✓ | libsmbclient | ✓ |
| libxml | ✓ | luasandbox | ✓ | lz4 | ✓ | lzf | ✓ |
| mailparse | ✓ | maxminddb | ✓ | mbstring | ✓ | mcrypt | ✓ |
| memcache | ✓ | memcached | ✓ | mongodb | ✓ | msgpack | ✓ |
| mysqli | ✓ | mysqlnd | ✓ | OAuth | ✓ | oci8 | ✓ |
| odbc | ✓ | opencensus | ✓ | openssl | ✓ | parle | ✓ |
| pcntl | ✓ | pcov | ✓ | pcre | ✓ | PDO | ✓ |
| pdo_dblib | ✓ | PDO_Firebird | ✓ | pdo_mysql | ✓ | PDO_OCI | ✓ |
| PDO_ODBC | ✓ | pdo_pgsql | ✓ | pdo_sqlite | ✓ | pdo_sqlsrv | ✓ |
| pgsql | ✓ | Phar | ✓ | php_trie | ✓ | posix | ✓ |
| protobuf | ✓ | pspell | ✓ | random | ✓ | raphf | ✓ |
| rdkafka | ✓ | readline | ✓ | redis | ✓ | Reflection | ✓ |
| SeasLog | ✓ | session | ✓ | shmop | ✓ | simdjson | ✓ |
| SimpleXML | ✓ | smbclient | ✓ | snappy | ✓ | snmp | ✓ |
| soap | ✓ | sockets | ✓ | sodium | ✓ | solr | ✓ |
| SPL | ✓ | SPX | ✓ | sqlite3 | ✓ | sqlsrv | ✓ |
| ssh2 | ✓ | standard | ✓ | Stomp | ✓ | swoole | ✓ |
| sysvmsg | ✓ | sysvsem | ✓ | sysvshm | ✓ | tidy | ✓ |
| timezonedb | ✓ | tokenizer | ✓ | uploadprogress | ✓ | uuid | ✓ |
| vips | ✓ | xdiff | ✓ | xlswriter | ✓ | xml | ✓ |
| xmldiff | ✓ | xmlreader | ✓ | xmlrpc | ✓ | xmlwriter | ✓ |
| xsl | ✓ | yac | ✓ | yaml | ✓ | Zend OPcache | ✓ |
| zephir_parser | ✓ | zip | ✓ | zlib | ✓ | zstd | ✓ |