NavigationContentFooter
Suggest an edit

Creating and migrating a secret into a specific path using the CLI and Go

Reviewed on 04 September 2024Published on 03 October 2023

This page shows you how to create a secret (ultra-confidential) and to migrate it into a path (/confidential-path) using the Scaleway CLI and the Go programming language.

Before you start

To complete the actions presented below, you must have:

  • A Scaleway account logged into the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization
  • Configured the Scaleway CLI
  • Created at least one Scaleway API key
  • Downloaded Go
  1. Open a terminal and run the following command to clone the repository containing the code you need to complete the procedure:

    git clone git@github.com:scaleway/tutorial-sem-folder-migrate.git
  2. In the same terminal, paste the following commands to export your environment variables. Make sure you add your own variables.

    export SCW_ACCESS_KEY=<Scaleway-API-access-key>
    export SCW_SECRET_KEY=<Scaleway-API-secret-key>
    export SCW_DEFAULT_ORGANIZATION_ID=<Scaleway default Organization>
    export SCW_DEFAULT_PROJECT_ID=<Scaleway default Project>
    export SCW_DEFAULT_REGION="fr-par"
    export SCW_API_URL="https://api.scaleway.com"
  3. Use the following command to access the tutorial-sem-folder-migrate directory:

    cd tutorial-sem-folder-migrate
  4. Run go run ./main.go to launch the creation of your secret and the migration process.

  5. Access your Scaleway account and verify that the secret and path display in the intended Project.

Docs APIScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCarreer
© 2023-2024 – Scaleway