Encrypt variable into your CDS project
To be able to write secret in the CDS yaml files, you have to encrypt data with the project GPG key.
Create a secret variable:
$ cdsctl encrypt MYPROJECT my-data my-super-secret-value
my-data: 01234567890987654321
The command returns the value: 01234567890987654321. You can use this value in a configuration file.
Example of use case: Import an environment with a secret.
Create an environment file to import :
$ cat << EOF > your-environment.yml
name: your-environment
values:
a-readable-variable:
type: string
value: value
my-data:
type: password
value: 01234567890987654321
EOF
Then, import then environment:
cdsctl environment import MYPROJECT your-environment.yml
Or push your workflow
cdsctl workflow push MYPROJECT *.yml
cdsctl encrypt [ PROJECT-KEY ] VARIABLE-NAME [SECRET-VALUE]
cdsctl encrypt MYPROJECT my-data my-super-secret-value
my-data: 01234567890987654321
-c, --context string cdsctl context name
-f, --file string set configuration file
--insecure (SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers.
-n, --no-interactive Set to disable interaction with ctl
--verbose Enable verbose output
Delete the given encrypted variable of your CDS project
List all the encrypted variable of your CDS project