packer-cn/vendor/github.com/scaleway/scaleway-sdk-go/scw
Patrik d4d78feed2
feat(scaleway): get image by label if not an UUID (#10061)
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
2020-10-07 16:04:00 +02:00
..
README.md feat(scaleway): get image by label if not an UUID (#10061) 2020-10-07 16:04:00 +02:00
client.go feat(builder): bump scaleway to new sdk (#9902) 2020-09-09 10:27:48 +02:00
client_option.go feat(builder): bump scaleway to new sdk (#9902) 2020-09-09 10:27:48 +02:00
config.go feat(scaleway): get image by label if not an UUID (#10061) 2020-10-07 16:04:00 +02:00
config_legacy.go feat(builder): bump scaleway to new sdk (#9902) 2020-09-09 10:27:48 +02:00
convert.go feat(builder): bump scaleway to new sdk (#9902) 2020-09-09 10:27:48 +02:00
custom_types.go feat(builder): bump scaleway to new sdk (#9902) 2020-09-09 10:27:48 +02:00
env.go feat(builder): bump scaleway to new sdk (#9902) 2020-09-09 10:27:48 +02:00
errors.go feat(builder): bump scaleway to new sdk (#9902) 2020-09-09 10:27:48 +02:00
locality.go feat(scaleway): get image by label if not an UUID (#10061) 2020-10-07 16:04:00 +02:00
path.go feat(builder): bump scaleway to new sdk (#9902) 2020-09-09 10:27:48 +02:00
request.go feat(builder): bump scaleway to new sdk (#9902) 2020-09-09 10:27:48 +02:00
request_option.go feat(builder): bump scaleway to new sdk (#9902) 2020-09-09 10:27:48 +02:00
version.go feat(scaleway): get image by label if not an UUID (#10061) 2020-10-07 16:04:00 +02:00

README.md

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

V1 config (DEPRECATED)

The V1 config (AKA legacy config) .scwrc is deprecated. To migrate the V1 config to the new format use the function MigrateLegacyConfig, this will create a proper config file the new config file path.

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

Variable Description Legacy variables
$SCW_ACCESS_KEY Access key of a token (get yours) $SCALEWAY_ACCESS_KEY (used by terraform)
$SCW_SECRET_KEY Secret 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_ID Your default organization ID (get yours) $SCW_ORGANIZATION (used by cli),$SCALEWAY_ORGANIZATION (used by terraform)
$SCW_DEFAULT_PROJECT_ID Your default project ID (get yours)
$SCW_DEFAULT_REGION Your default region $SCW_REGION (used by cli),$SCALEWAY_REGION (used by terraform)
$SCW_DEFAULT_ZONE Your default availability zone $SCW_ZONE (used by cli),$SCALEWAY_ZONE (used by terraform)
$SCW_API_URL Url of the API -
$SCW_INSECURE Set this to true to enable the insecure mode $SCW_TLSVERIFY (inverse flag used by the cli)
$SCW_PROFILE Set the config profile to use -