# Redis database plugin HTTP API

The Redis database plugin is one of the supported plugins for the database secrets engine. This plugin generates database credentials dynamically based on configured roles for the Redis database.

### Configure connection <a href="#configure-connection" id="configure-connection"></a>

In addition to the parameters defined by the [Database Secrets Engine](https://developer.hashicorp.com/vault/api-docs/secret/databases#configure-connection), this plugin has a number of parameters to further configure a connection.

| Method | Path                     |
| ------ | ------------------------ |
| `POST` | `/database/config/:name` |

#### Parameters <a href="#parameters" id="parameters"></a>

* [`host`](https://developer.hashicorp.com/vault/api-docs/secret/databases/redis#host) `(string: <required>)` – Specifies the host to connect to.
* [`port`](https://developer.hashicorp.com/vault/api-docs/secret/databases/redis#port) `(int: <required>)` – Specifies the port number of the connection.
* [`username`](https://developer.hashicorp.com/vault/api-docs/secret/databases/redis#username) `(string: <required>)` – Specifies the username for Vault to use.
* [`password`](https://developer.hashicorp.com/vault/api-docs/secret/databases/redis#password) `(string: <required>)` – Specifies the password corresponding to the given username.
* [`tls`](https://developer.hashicorp.com/vault/api-docs/secret/databases/redis#tls) `(bool: false)` – Specifies whether to use TLS when connecting to Redis.
* [`insecure_tls`](https://developer.hashicorp.com/vault/api-docs/secret/databases/redis#insecure_tls) `(bool: false)` – Specifies whether to skip verification of the server certificate when using TLS.

#### Sample payload <a href="#sample-payload" id="sample-payload"></a>

```json
{
  "plugin_name": "redis-database-plugin",
  "host": "localhost://127.0.0.1",
  "username": "user",
  "password": "pass",
  "allowed-roles": "my-*-role"
}
```

#### Sample request <a href="#sample-request" id="sample-request"></a>

```shell-session
$ curl \
    --header "X-Vault-Token: ..." \
    --request POST \
    --data @payload.json \
    http://127.0.0.1:8200/v1/database/config/redis
```

### Statements <a href="#statements" id="statements"></a>

Statements are configured during role creation and are used by the plugin to determine what is sent to the database on user creation, renewing, and revocation. For more information on configuring roles see the [Role API](https://developer.hashicorp.com/vault/api-docs/secret/databases#create-role) in the database secrets engine docs.

#### Parameters <a href="#parameters-1" id="parameters-1"></a>

The following are the statements used by this plugin. If not mentioned in this list the plugin does not support that statement type.

* [`creation_statements`](https://developer.hashicorp.com/vault/api-docs/secret/databases/redis#creation_statements) `(list: [])` – Specifies a JSON string containing [Redis ACL rules](https://redis.io/commands/acl-cat) to assign to created users. If not provided, defaults to a read-only user that can read any key.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.enclaive.cloud/vault/api/secrets-engines/database/redis-database-plugin-http-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
