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
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:
https://api.scaleway.com
by default)false
by default)true
by default)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
access_key: EXAMPLESCW34P0XKFD4secret_key: example-2b41-8d52-f888-8c8a460edefault_organization_id: example-468g-4f65-a41e-8b40766c5fc5default_project_id: example-468g-4f65-a41e-8b40766c5fc5default_zone: fr-par-1default_region: fr-parapi_url: https://api.scaleway.com
profiles:myProfile1:access_key: EXAMPLESCW34P0XKFD4secret_key: example-2b41-8d52-f888-8c8a460edefault_organization_id: example-468g-4f65-a41e-8b40766c5fc5default_project_id: example-468g-4f65-a41e-8b40766c5fc5default_zone: fr-par-1default_region: fr-parapi_url: https://api.scaleway.cominsecure: falsemyProfile2:access_key: EXAMPLESCW34PM3C0XKsecret_key: example-2b41-460e-8d52-f8888c8adefault_organization_id: example-776f-4f65-a41e-6c5fc58b4076default_project_id: example-776f-4f65-a41e-6c5fc58b4076default_zone: fr-par-2default_region: fr-parapi_url: https://api.scaleway.cominsecure: true
You can select the profile to use by either:
$SCW_PROFILE
environment variableGetActiveProfile()
function in the SDKs--profile=<your-profile>
flag with the CLIMake 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