NavigationContentFooter
Jump toSuggest an edit
Was this page helpful?

How to use Private Networks with your Serverless Functions

Reviewed on 25 June 2025Published on 25 June 2021

Private Networks allow your Serverless Functions to communicate in an isolated and secure network without needing to be connected to the public internet. Each function can be connected to one or several Private Networks, letting you build your own network topologies.

For full information about Scaleway Private Networks and VPC, see our dedicated documentation and best practice guide.

Important

The Private Networks feature can only be enabled on newly created namespaces. Existing namespaces that do not have the feature enabled cannot be integrated in a Private Network.

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
  • Created a Private Network

How to create a Private NetworkLink to this anchor

This action must be carried out from the VPC section of the console. Follow the procedure detailed in our dedicated VPC documentation.

How to create a Private Networks-enabled namespaceLink to this anchor

Before attaching a Private Network to a Serverless Function, you must create it within a namespace with the Private Networks feature enabled.

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

  2. Click + Create namespace. If you have no existing Serverless Functions resources in your current Project, click Create a function. The functions namespace creation wizard displays.

  3. Complete the following steps in the wizard:

    • Enter a name or use the automatically generated one. The name can only contain lowercase alphanumeric characters and dashes.
    • Enter an optional description and tags.
    • Choose a region, which is the geographical location in which your namespace will be deployed.
    • Tick the Enable VPC support box. This parameter cannot be edited once the namespace is created.
    • Click + Add advanced options to define any environment variables you want to inject into your function. For each environment variable, click + Add variable and enter the key/value pair.
    • Set optional 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.
  4. Click Create namespace only to finish, or click Create namespace and add a function if you want to create a function next.

How to attach a Serverless Function to a Private NetworkLink to this anchor

  1. Click Functions in the Serverless section of the side menu. The functions page displays.
  2. Click the relevant functions namespace.
  3. Click the name of the function you want to manage.
  4. Open the Settings tab, then scroll to the Advanced options section.
  5. In the VPC tab, select a Private Network from the dropdown menu.
  6. Click Save function settings.

Your function is redeployed, and is now attached to the selected Private Network.

How to detach a function from a Private NetworkLink to this anchor

  1. Click Functions in the Serverless section of the side menu. The functions page displays.
  2. Click the relevant functions namespace.
  3. Click the name of the function you want to manage.
  4. Open the Settings tab, then scroll to the Advanced options section.
  5. In the VPC tab, click the «Unlink Icon» icon next to the Private Network attached to your function.
  6. Click Save function settings.

Your function is redeployed and is now detached from the Private Network.

How to delete a Private NetworkLink to this anchor

Note

Before deleting a Private Network, you must detach all resources attached to it.

This must be carried out from the VPC section of the console. Follow the procedure detailed in our dedicated VPC documentation.

See also
How to secure a functionHow to monitor function logs and metrics
Was this page helpful?
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2025 – Scaleway