Creating a workload secret for Cloudera Data Engineering Spark Jobs using CLI
You can create workload secrets using interactive mode or using a JSON file. You can use the --workload-cred-json-file and the --workload-cred-key flags along with the --type flag supporting workload-credential.
Before you begin
Make sure that you have downloaded the CLI client. For more information, see Using the Cloudera Data Engineering command line interface .
- Specify
--workload-cred-key
when prompted for secret values multiple times. The values which are sensitive are read as a hidden password field interactively from the CLI../cde credential create --name <workload-credential-name> --type workload-credential --workload-cred-key <workload-credential_key> --workload-cred-key <workload-credential_key>
For example:./cde credential create --name workload-cred-1 --type workload-credential --workload-cred-key db-pass --workload-cred-key aws-secret Enter Secret value for Workload Cred key "db-pass" : Re-enter Secret value for Workload Cred key "db-pass" : Enter Secret value for Workload Cred key "aws-secret" : Re-enter Secret value for Workload Cred key "aws-secret" :
- Create a JSON file with workload secret keys.
sample.json file { "<workload-credential-key>": "<secret_value_of_key>", "<workload-credential-key>": "<secret_value_of_key>" }
For example:sample.json file { "aws-secret": "secret123", "db-pass": "dbpass123" }
- Run the following command to create the workload secret:
./cde credential create --name <workload-credential-name> --type workload-credential --workload-cred-json-file <workload-credential-json-file-name>
For example:
./cde credential create --name workload-cred-1 --type workload-credential --workload-cred-json-file sample.json