Skip to content
15 changes: 15 additions & 0 deletions macros/developer-tools/environment-variables-priority.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
macro: environment-variables-priority
---

## Environment variables priority

When the same environment variable is injected by multiple sources, the Scaleway infrastructure follows a precedence rule to determine the value for that variable.

The order of precedence, from highest to lowest is the following.

1. Environment variables defined in your command-line environment.

2. Static variables (i.e. variables set in a Terraform/OpenTofu configuration file).

3. Variables defined in the [Scaleway configuration file](/scaleway-sdk/reference-content/scaleway-configuration-file/).
13 changes: 3 additions & 10 deletions macros/developer-tools/scaleway-environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
macro: scaleway-environment-variables
---

import EnvironmentVariablesPriority from '@macros/developer-tools/environment-variables-priority.mdx'

## Reserved environment variables

The following standardized Scaleway environment variables are used for the CLI and API.
Expand All @@ -18,14 +20,5 @@ The following standardized Scaleway environment variables are used for the CLI a
| `$SCW_PROJECT_ID` | Your [Project ID](https://console.scaleway.com/project/settings) | `$SCW_DEFAULT_PROJECT_ID` |
| `$SCW_ORGANIZATION_ID` | Your [Organization ID](https://console.scaleway.com/organization/settings) | `$SCW_DEFAULT_ORGANIZATION_ID`, `$SCW_ORGANIZATION` (used by the CLI),`$SCALEWAY_ORGANIZATION` (used by Terraform/OpenTofu) |

## Environment variables priority

When the same environment variable is injected by multiple sources, the Scaleway infrastructure follows a precedence rule to determine the value for that variable.

The order of precedence, from highest to lowest is the following.

1. Environment variables defined in your command-line environment.

2. Static variables (i.e. variables set in a Terraform/OpenTofu configuration file).

3. Variables defined in the [Scaleway configuration file](/scaleway-sdk/reference-content/scaleway-configuration-file/)
<EnvironmentVariablesPriority/>
4 changes: 4 additions & 0 deletions pages/serverless-jobs/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ export const serverlessJobsMenu = {
label: 'Jobs limitations',
slug: 'jobs-limitations',
},
{
label: 'Injected environment variables',
slug: 'injected-environment-variables',
},
{
label: 'Differences between Jobs, Functions and Containers',
slug: 'difference-jobs-functions-containers',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: Injected environment variables
description: This page contains a list of environment variables injected by default in the Job Runs.
tags: serverless jobs environment variables
dates:
validation: 2026-02-16
posted: 2026-02-16
---
import EnvironmentVariablesPriority from '@macros/developer-tools/environment-variables-priority.mdx'

The following standardized Scaleway environment variables are injected by default in the Job runs to improve and optimize data management.

| Variable name | Description | Sample value |
| :--------------------------- | :------------------------------------- | :------------------------------------- |
| `$SCW_SLS_RESOURCE_ID` | ID of the Job run | `00000000-0000-0000-0000-000000000000` |
| `$SCW_SLS_PARENT_ID` | ID of the Job definition | `00000000-0000-0000-0000-000000000000` |
| `$SCW_SLS_RESOURCE_NAME` | Name of the Job run | `"job-name"` |
| `$SCW_SLS_PROJECT_ID` | ID of the Project of the Job | `00000000-0000-0000-0000-000000000000` |
| `$SCW_SLS_ORGANIZATION_ID` | ID of the Organization of the Job | `00000000-0000-0000-0000-000000000000` |
| `$SCW_SLS_CPU` | vCPU limit of the Job run | `560` |
| `$SCW_SLS_RAM` | Memory limit of the Job run | `1024` |
| `$SCW_SLS_EPHEMERAL_STORAGE` | Ephemeral storage limit of the Job run | `1000` |
| `$SCW_SLS_IMAGE` | Image of the Job run | `scaleway/cli:latest` |
| `$SCW_SLS_REGION` | Region of the Job run | `fr-par` |

<EnvironmentVariablesPriority/>
Loading