Creating and migrating a secret into a specific path using the CLI and Go
Reviewed on 13 February 2024 • Published on 03 October 2023
This documentation allows you to create a secret called ultra-confidential
and to migrate it into /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
-
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 -
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
tutorial-sem-folder-migrate
directory:cd tutorial-sem-folder-migrate -
Run
go run ./main.go
to launch the creation of your secret and the migration process.