NavigationContentFooter
Jump toSuggest an edit

How to create, manage, and delete a Functions Namespace

Reviewed on 14 November 2024Published on 26 May 2021

This page shows you how to create, manage, and delete a Functions namespace using the Scaleway console.

Namespaces allow you to group your functions and share environment variables, secrets and tokens between them.

Before you start

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

Creating a Serverless Functions namespace

  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.
    • Choose a region, which is the geographical location in which your namespace will be deployed.
    • 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.

Managing a Serverless Functions namespace

Generating and managing access tokens

The Scaleway console allows you to generate authentication tokens to grant users and applications access to the functions present in your namespace.

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

  2. Click the functions namespace you want to manage.

  3. Click the Namespace settings tab. Information about the region, registry endpoint and description of your namespace display.

  4. Click + Generate token to create an access token for this namespace.

    Important

    The token key will only be available for copy once. Make sure to store it securely before leaving the page.

Private functions present in your namespace now require the authentication token to be executed, as shown below:

curl -H "X-Auth-Token: <YOUR_FUNCTION_TOKEN>" <YOUR_FUNCTION_ENDPOINT>

Managing environment variables and secrets

The Scaleway console allows you to define environment variables and secrets at the namespace-level to pass to the functions present in the namespace.

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

  2. Click the functions namespace you want to manage.

  3. Click the Namespace settings tab. Information about the region, registry endpoint and description of your namespace display.

  4. Add any additional environment variables by clicking the «Edit Icon» icon, + Add variable, entering the key/value pair, and clicking «Validate Icon».

  5. Add any additional secrets by clicking the «Edit Icon» icon, + Add secret, entering the key/value pair, and clicking «Validate Icon».

The environment variables and secrets defined will now be passed to your functions. Every function in a ready state is redeployed to take the change into account.

Deleting a Serverless Functions namespace

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

  2. Click the «See more Icon» icon next to the namespace you want to delete, and select Delete from the drop-down menu.

  3. Type DELETE in the pop-up that asks you to confirm the action, then click Delete namespace.

Tip

You can also delete a namespace from the Namespace settings tab.

See also
How to create a function
Was this page helpful?
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2024 – Scaleway