NavigationContentFooter
Suggest an edit

Scaleway CLI - Configuration file

Reviewed on 23 April 2024Published on 23 April 2023

Configuration file Overview

The Scaleway configuration file is a config.yaml file shared between the majority of the Scaleway developer tools. It allows you to authenticate, and to determine the default values to use when creating resources with the developer tools.

The configuration file contains the following elements:

access_key
Your Scaleway API access key
secret_key
Your Scaleway API secret key
default_organization_id
The ID of the Scaleway Organization to use by default
default_project_id
The ID of the Scaleway Project to use by default
default_zone
The availability zone to use by default
default_region
The region to use by default
api_url
The API URL to use (https://api.scaleway.com by default)
insecure
Parameter to allow insecure traffic on the client (false by default)
send-telemetry
Parameter to disable the collection of diagnostic and usage data (true by default)
profiles
A YAML dictionary that can contain different profiles (refer to the example below)

How to set up the configuration file

You can set up the Scaleway configuration file using several methods. However, we recommend that you use The Scaleway CLI. The scw init command allows you to initialize your configuration in just a few minutes.

To initialize the configuration without the Scaleway CLI, you can simply create a config.yaml file in the appropriate folder:

  • a custom directory defined as $SCW_CONFIG_PATH

  • an XDG base directory: $XDG_CONFIG_HOME/scw/config.yaml

  • the MacOS/Linux home directory: $HOME/.config/scw/config.yaml

  • the Windows home directory: %USERPROFILE%/.config/scw/config.yaml

Configuration file example

Single profile configuration file

access_key: EXAMPLESCW34P0XKFD4
secret_key: example-2b41-8d52-f888-8c8a460e
default_organization_id: example-468g-4f65-a41e-8b40766c5fc5
default_project_id: example-468g-4f65-a41e-8b40766c5fc5
default_zone: fr-par-1
default_region: fr-par
api_url: https://api.scaleway.com

Multi-profile configuration file

profiles:
myProfile1:
access_key: EXAMPLESCW34P0XKFD4
secret_key: example-2b41-8d52-f888-8c8a460e
default_organization_id: example-468g-4f65-a41e-8b40766c5fc5
default_project_id: example-468g-4f65-a41e-8b40766c5fc5
default_zone: fr-par-1
default_region: fr-par
api_url: https://api.scaleway.com
insecure: false
myProfile2:
access_key: EXAMPLESCW34PM3C0XK
secret_key: example-2b41-460e-8d52-f8888c8a
default_organization_id: example-776f-4f65-a41e-6c5fc58b4076
default_project_id: example-776f-4f65-a41e-6c5fc58b4076
default_zone: fr-par-2
default_region: fr-par
api_url: https://api.scaleway.com
insecure: true
Note

You can select the profile to use by either:

  • declaring it as the $SCW_PROFILE environment variable
  • using the GetActiveProfile() function in the SDKs
  • use the --profile=<your-profile> flag with the CLI

Troubleshooting

  • Make sure that you have generated and specified a valid access_key and secret_key pair. Refer to the API keys documentation for more information.

  • Make sure that there is no conflicting environment variable set, such as $SCW_ACCESS_KEY and $SCW_SECRET_KEY. You can remove environment variables using the unset command as shown below:

    unset $SCW_ACCESS_KEY $SCW_SECRET_KEY
Docs APIScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCarreer
© 2023-2024 – Scaleway