# ry resource

> Manage attachable resources (redis, postgres).

```text
ry resource [options] [command]
```

## Subcommands

### `ry resource create`

Create an org resource, e.g. a redis or postgres instance.

```text
ry resource create [options] <name>
```

Options:

- `-k, --kind <kind>`: Resource kind: redis | postgres. Default: `redis`.
- `-m, --memory <mb>`: Memory in MB. Default: `1024`.
- `-s, --size <gb>`: Durable volume size in GB (postgres gets one by default, and needs at least 4).
- `--ha`: High availability: primary + standby on separate hosts, automatic failover (durability host-redundant).
- `--durability <durability>`: Explicit durability level (standard | host-redundant).
- `--locale <locale>`: Collation locale of the database, e.g. de-DE, fr-FR, de-DE-u-co-phonebk (postgres only).
- `--always-on`: Store the policy 'always on' (never suspend) instead of the default policy 'suspend after 5m idle' (postgres only).
- `--sleep-after <duration>`: Store the sleep policy 'suspend after this long without a query or traffic', e.g. 5m, 1h (postgres only, 10s to 1d).

Example:

```bash
ry resource create cache --kind redis
```

### `ry resource sleep`

Set the sleep policy of a postgres resource: --after `<duration>` or --off (always on).

```text
ry resource sleep [options] <name>
```

Options:

- `--after <duration>`: Store 'suspend after this long without a query or traffic', e.g. 5m, 1h (10s to 1d).
- `--off`: Store 'always on': never suspend.

Example:

```bash
ry resource sleep cache --off
```

### `ry resource list`

List resources.

```text
ry resource list [options]
```

Example:

```bash
ry resource list
```

### `ry resource destroy`

Destroy a resource, its machines and its volumes (irreversible).

```text
ry resource destroy [options] <name>
```

Options:

- `-y, --yes`: Confirm without asking (automation, and the way back after consent).

Example:

```bash
ry resource destroy cache --yes
```
