Migrating secrets into folders using the CLI and Go
This documentation shows you how to migrate your secrets into folders using the Scaleway CLI and the Go programming language. We have created a GitHub repository containing the necessary code to create the folder to which you will migrate your secrets using their IDs.
You may need certain IAM permissions to carry out some actions described on this page. This means:
Open a terminal and run the following command to clone the repository containing the code you need to create a folder and migrate your secrets:git clone email@example.com:scaleway/tutorial-sem-migration.git
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 access key>export SCW_SECRET_KEY=<Scaleway 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"
Use the following command to access the
Open a text editor of your choice and open the
main.gofile inside the
34with the name of your folder.Important:
Your folder name can only contain alphanumeric characters, dots, underscores, and dashes.
20with the IDs of the secrets you want to migrate. You can find your secrets’ IDs in the secret’s Overview tab.Note:
You can add as many IDs as you need to fit the amount of secrets you want to migrate into your folder.
Save your changes in the
go run ./main.goto launch the migration.
Optionally, follow the same procedure if you need to migrate other secrets into other folders.