> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rafftechnologies.com/llms.txt
> Use this file to discover all available pages before exploring further.

# raff_database_user

> Manage users inside a Raff managed database with Terraform, with read-only or read-write access.

<sub>Updated October 5, 2026</sub>

Manages a **user inside a managed database**. Use one per app or person instead of sharing the admin user.

## Example

```hcl theme={null}
resource "raff_database_user" "reporting" {
  database_id = raff_database.orders.database_id
  name        = "reporting"
  role        = "readonly"
}

output "reporting_password" {
  value     = raff_database_user.reporting.password
  sensitive = true
}
```

## Argument reference

| Argument | Type | Required? | Description |
| - | - | - | - |
| `database_id` | string | Yes | Short ID of the database |
| `name` | string | Yes | 3 to 31 characters: a lowercase letter, then lowercase letters, digits, or underscores. Names starting with `app_` or `fnb_` are reserved for Raff Apps and Functions |
| `role` | string | No | `readonly` (default) or `readwrite` |

Changing any argument replaces the user.

## Attribute reference (computed)

| Attribute | Description |
| - | - |
| `id` | `<database_id>/<name>` |
| `password` | The user's password (sensitive) |
| `scope` | The database, schema, or keyspace the access applies to |

## Import

```bash theme={null}
terraform import raff_database_user.reporting <database-id>/<name>
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.