{
  "schema_version": 2,
  "id": "integrate/redis-data-integration/reference/cli/redis-di-set-secret",
  "title": "redis-di set-secret",
  "url": "https://redis.io/docs/latest/integrate/redis-data-integration/2.0.0/reference/cli/redis-di-set-secret/",
  "summary": "Creates or updates a secret of a pipeline",
  "content": "\nCreates or updates a secret of a pipeline. Secrets hold the credentials and certificates that the\npipeline uses to connect to its source and target databases (see\n[Set secrets](https://redis.io/docs/latest/integrate/redis-data-integration/data-pipelines/deploy#set-secrets)\nfor the secret keys). Every secret belongs to one database, which you name with `--db`: a source, or\n`target`. RDI combines the key and the database into the environment variable that `config.yaml`\nreferences, so `PASSWORD` with `--db mysql` becomes `${MYSQL_DB_PASSWORD}`. For a source that\nexisted before RDI supported multiple sources, the variable is still named `SOURCE_DB_PASSWORD`; see\n[Existing names are kept after an upgrade](https://redis.io/docs/latest/integrate/redis-data-integration/data-pipelines/multiple-sources#existing-names-are-kept-after-an-upgrade).\n\nThe secret value comes from the `[value]` argument, the `--file` option, or the `--literal` option.\nIf you provide none of these on an interactive terminal, the command prompts for the value without\nechoing it.\n\n## Usage\n\n```\nredis-di set-secret \u003ckey\u003e [value] [flags]\n```\n\n## Options\n\n| Option             | Description                                                                       |\n| :----------------- | :-------------------------------------------------------------------------------- |\n| `-p`, `--pipeline` | Pipeline to target (default `default`).                                           |\n| `--db`             | Database the secret belongs to: a source name, or `target`.                       |\n| `--file`           | Read the secret value from the file at this path.                                 |\n| `--literal`        | Use this literal string as the secret value.                                      |\n| `--wait`           | Wait for the pipeline to reach the expected state (default `true`).               |\n| `--timeout`        | Maximum time to wait for the pipeline to reach the expected state (default `2m`). |\n\nThis command also accepts the\n[global options](https://redis.io/docs/latest/integrate/redis-data-integration/reference/cli/redis-di#global-options).\n\n## Example\n\n```bash\n# Value from an argument\nredis-di set-secret USERNAME --db mysql myuser\n\n# Value from a file (for example, a certificate)\nredis-di set-secret CACERT --db mysql --file /path/to/myca.crt\n\n# Value read from an interactive prompt\nredis-di set-secret PASSWORD --db mysql\n\n# Target database credentials\nredis-di set-secret PASSWORD --db target mypassword\n```\n",
  "tags": ["redis-di"],
  "last_updated": "2026-10-30T16:31:14Z"
}
