package
1.0.0-beta.35
Repository: https://github.com/scaleway/scaleway-sdk-go.git
Documentation: pkg.go.dev

# README

Scaleway config

TL;DR

Recommended config file:

# Get your credentials on https://console.scaleway.com/project/credentials
access_key: SCWXXXXXXXXXXXXXXXXX
secret_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
default_organization_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
default_project_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
default_region: fr-par
default_zone: fr-par-1

Config file path

The function GetConfigPath will try to locate the config file in the following ways:

  1. Custom directory: $SCW_CONFIG_PATH
  2. XDG base directory: $XDG_CONFIG_HOME/scw/config.yaml
  3. Unix home directory: $HOME/.config/scw/config.yaml
  4. Windows home directory: %USERPROFILE%/.config/scw/config.yaml

Reading config order

ClientOption ordering will decide the order in which the config should apply:

p, _ := scw.MustLoadConfig().GetActiveProfile()

scw.NewClient(
    scw.WithProfile(p),                     // active profile applies first
    scw.WithEnv(),                          // existing env variables may overwrite active profile
    scw.WithDefaultRegion(scw.RegionFrPar)  // any prior region set will be discarded to usr the new one
)

Environment variables

VariableDescriptionLegacy variables
$SCW_ACCESS_KEYAccess key of a token (get yours)$SCALEWAY_ACCESS_KEY (used by terraform)
$SCW_SECRET_KEYSecret key of a token (get yours)$SCW_TOKEN (used by cli), $SCALEWAY_TOKEN (used by terraform), $SCALEWAY_ACCESS_KEY (used by terraform)
$SCW_DEFAULT_ORGANIZATION_IDYour default organization ID (get yours)$SCW_ORGANIZATION (used by cli),$SCALEWAY_ORGANIZATION (used by terraform)
$SCW_DEFAULT_PROJECT_IDYour default project ID (get yours)
$SCW_DEFAULT_REGIONYour default region$SCW_REGION (used by cli),$SCALEWAY_REGION (used by terraform)
$SCW_DEFAULT_ZONEYour default availability zone$SCW_ZONE (used by cli),$SCALEWAY_ZONE (used by terraform)
$SCW_API_URLUrl of the API-
$SCW_INSECURESet this to true to enable the insecure mode$SCW_TLSVERIFY (inverse flag used by the cli)
$SCW_PROFILESet the config profile to use-