# Storage

> For the complete documentation index, see [llms.txt](https://docs.ringleader.dev/llms.txt).


> Keep a namespace's session transcripts and uploaded files in a bucket in your own GCP, AWS or Azure account.


A **Storage** object tells Ringleader which bucket holds a namespace's files. Those files are the
transcripts of agent sessions, files people upload with `rl artifact upload`, and files
workstations publish. The bucket lives in your own cloud account, so you decide its location, how
long it keeps old data, and which key encrypts it.

[Storage buckets](https://docs.ringleader.dev/cloud-accounts/storage-buckets/) explains the artifact storage grant, managed and named buckets, and how to create a Storage, switch buckets and delete one. [Session transcripts and artifacts](https://docs.ringleader.dev/organizations-teams/transcripts-artifacts/) says what happens to the files with no Storage.

## Spec fields

| Field | Type | Description |
|-------|------|-------------|
| `provider` | `string` | **Required.** `gcp`, `aws` or `azure`. Cannot change. |
| `bucket` | `string` | **Required.** The GCS bucket, S3 bucket or Azure container. Cannot change. |
| `account` | `string` | **Azure only, required there.** The storage account that holds the container. Cannot change. |
| `prefix` | `string` | Where in the bucket the namespace's folder starts. Must end in `/`. Cannot change. |
| `cloudIdentityRef` | `string` | **Required.** The name of a CloudIdentity in the same namespace. |
| `grant` | `string` | **Required.** `managed` or `named`, matching how your organization took the artifact storage grant. |
| `default` | `bool` | Marks this Storage as the namespace's default when it has several Storage objects. |
| `createBucket` | `bool` | Create the bucket when it is missing. `managed` only. Cannot change. |
| `location` | `string` | The region for a bucket Ringleader creates. Required with `createBucket`, refused without it. Cannot change. |
| `bucketDeletionPolicy` | `string` | `Retain` (the default) or `DeleteIfEmpty`. `DeleteIfEmpty` needs `createBucket`. |
| `versioning` | `bool` | Keep old versions in a bucket Ringleader creates. Default `false`. Refused with `named`. |
| `noncurrentVersionDays` | `int` | How long an old version is kept, 0 to 36500 days. Default `30`, and `0` keeps them forever. |

## Status fields

| Field | Description |
|-------|-------------|
| `reachable` | Whether Ringleader could reach the bucket the last time it checked. |
| `location` | The bucket's region, read from the cloud. |
| `encryption.type` | `provider-managed`, `customer-managed`, or `unknown` when Ringleader could not read it. |
| `encryption.keyName` | Your key's name, when the bucket uses one. |
| `versioning` | Whether the bucket keeps old versions. |
| `default` | Whether this Storage is the namespace's default now. |
| `payloads` | How many files are recorded in this bucket. |
| `createdBucket`, `createdBucketAt` | The bucket Ringleader created for this Storage, and when. |
| `existingNotOurs` | The bucket already existed, so Ringleader uses it as it is and never deletes it. |
| `creationRefused` | The cloud refused the bucket name, usually because someone else already has it. Delete the Storage and create one with another name. |
| `message` | What is wrong, when something is. |
| `lastVerified` | When Ringleader last checked the bucket. |

## Next steps
- [Cloud accounts](https://docs.ringleader.dev/cloud-accounts/): connecting a cloud account, including the
  artifact storage grant.
- [CloudIdentity](https://docs.ringleader.dev/reference/resources/cloudidentity/): the credentials a Storage uses to
  reach its bucket.
- [Policy and OrgPolicy](https://docs.ringleader.dev/reference/resources/policy/): limit which Storage an upload or a session may name.

