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

# Use Cloud Storage

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

CockroachDB constructs a secure API call to the cloud storage specified in a URL passed to one of the following statements:

* <InternalLink path="backup">`BACKUP`</InternalLink>
* <InternalLink path="restore">`RESTORE`</InternalLink>
* <InternalLink path="import-into">`IMPORT INTO`</InternalLink>
* <InternalLink path="export">`EXPORT`</InternalLink>
* <InternalLink path="create-changefeed">`CREATE CHANGEFEED`</InternalLink>

<Note>
  Cockroach Labs recommends enabling Egress Perimeter Controls on CockroachDB Advanced clusters to mitigate the risk of data exfiltration when accessing external resources, such as cloud storage for change data capture or backup and restore operations. See <InternalLink version="cockroachcloud" path="egress-perimeter-controls">Egress Perimeter Controls</InternalLink> for detail and setup instructions.
</Note>

<Tip>
  We strongly recommend using cloud/remote storage.
</Tip>

## URL format

URLs for the files you want to import must use the format shown below. For examples, see [Example file URLs](#example-file-urls).

```
[scheme]://[host]/[path]?[parameters]
```

You can create an external connection to represent an external storage or sink URI. This allows you to specify the external connection's name in statements rather than the provider-specific URI. For detail on using external connections, see the <InternalLink path="create-external-connection">`CREATE EXTERNAL CONNECTION`</InternalLink> page.

The following table provides a list of the parameters supported by each storage scheme. For detail on authenticating to each cloud storage provider, see the <InternalLink path="cloud-storage-authentication">Cloud Storage Authentication</InternalLink> page.

| Location                                  | Scheme                     | Host                                                                                   | Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------------------------- | -------------------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Amazon S3                                 | `s3`                       | Bucket name                                                                            | <InternalLink path="cloud-storage-authentication#amazon-s3-specified">`AUTH`</InternalLink>: `implicit` or `specified` (default: `specified`). When using `specified` pass user's `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.<br /><br /><InternalLink path="cloud-storage-authentication#set-up-amazon-s3-assume-role">`ASSUME_ROLE`</InternalLink> (optional): Pass the [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of the role to assume. You must [URL encode](https://www.w3schools.com/tags/ref_urlencode.ASP) this entire value. Use in combination with `AUTH=implicit` or `specified`.<br /><br />`AWS_ENDPOINT` (optional): Specify a custom endpoint for Amazon S3 or S3-compatible services. Use to define a particular region or a Virtual Private Cloud (VPC) endpoint.<br /><br /><InternalLink path="cloud-storage-authentication">`AWS_SESSION_TOKEN`</InternalLink> (optional): Use as part of temporary security credentials when accessing AWS S3. For more information, refer to Amazon's guide on [temporary credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html).<br /><br />`AWS_USE_PATH_STYLE` (optional): Change the URL format to path style from the default AWS S3 virtual-hosted–style URLs when connecting to Amazon S3 or S3-compatible services.<br /><br />[`S3_STORAGE_CLASS`](#amazon-s3-storage-classes) (optional): Specify the Amazon S3 storage class for created objects. Note that Glacier Flexible Retrieval and Glacier Deep Archive are not compatible with incremental backups. **Default**: `STANDARD`.                                                                                                                                                                                                                                                                                                                                                               |
| Azure Blob Storage                        | `azure-blob` / `azure`     | Storage container                                                                      | `AZURE_ACCOUNT_NAME`: The name of your Azure account.<br /><br />`AZURE_ACCOUNT_KEY`: Your Azure account key. You must [url encode](https://wikipedia.org/wiki/Percent-encoding) your Azure account key before authenticating to Azure Storage. For more information, see <InternalLink path="cloud-storage-authentication#azure-blob-storage-specified-authentication">Authentication - Azure Storage</InternalLink>.<br /><br />`AZURE_ENVIRONMENT`: (optional) The [Azure environment](https://learn.microsoft.com/azure/deployment-environments/concept-environments-key-concepts#environments) that the storage account belongs to. The accepted values are: `AZURECHINACLOUD`, `AZUREGERMANCLOUD`, `AZUREPUBLICCLOUD`, and [`AZUREUSGOVERNMENTCLOUD`](https://learn.microsoft.com/azure/azure-government/documentation-government-developer-guide). These are cloud environments that meet security, compliance, and data privacy requirements for the respective instance of Azure cloud. If the parameter is not specified, it will default to `AZUREPUBLICCLOUD`.<br /><br />`AZURE_CLIENT_ID`: Application (client) ID for your [App Registration](https://learn.microsoft.com/azure/active-directory/develop/quickstart-register-app#register-an-application).<br /><br />`AZURE_CLIENT_SECRET`: Client credentials secret generated for your App Registration.<br /><br />`AZURE_TENANT_ID`: Directory (tenant) ID for your App Registration.<br /><br />Cockroach Labs supports Azure's General Purpose v2 Standard storage account type. For more details, refer to the Azure [Storage Account documentation](https://learn.microsoft.com/azure/storage/blobs/storage-blobs-introduction#storage-accounts).<br /><br />**Note:** For <InternalLink path="changefeed-sinks">changefeeds</InternalLink>, you must use the `azure://` scheme. For all other jobs,  the `azure://` and `azure-storage://` schemes are also supported for backward compatibility, though `azure-blob://` is recommended. |
| Google Cloud Storage                      | `gs`                       | Bucket name                                                                            | `AUTH`: `implicit`, or `specified` (default: `specified`); `CREDENTIALS`<br /><br /><InternalLink path="cloud-storage-authentication#set-up-google-cloud-storage-assume-role">`ASSUME_ROLE`</InternalLink> (optional): Pass the [service account name](https://cloud.google.com/iam/docs/understanding-service-accounts) of the service account to assume. You must [URL encode](https://www.w3schools.com/tags/ref_urlencode.ASP) this entire value. <br /><br />For more information, see <InternalLink path="cloud-storage-authentication#google-cloud-storage-specified">Authentication - Google Cloud Storage</InternalLink>.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| HTTP                                      | `file-http(s)` / `http(s)` | Remote host                                                                            | N/A<br /><br />**Note:** Using `http(s)` without the `file-` prefix is deprecated as a <InternalLink path="changefeed-sinks">changefeed sink</InternalLink> scheme. There is continued support for `http(s)`, but it will be removed in a future release. We recommend implementing the `file-http(s)` scheme for changefeed messages.<br /><br />For more information, refer to <InternalLink path="cloud-storage-authentication#http-authentication">Authentication - HTTP</InternalLink>.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| NFS/Local [<sup>1</sup>](#considerations) | `nodelocal`                | `nodeID` [<sup>2</sup>](#considerations) (see [Example file URLs](#example-file-urls)) | N/A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

<Tip>
  The location parameters often contain special characters that need to be URI-encoded. Use Javascript's [encodeURIComponent](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) function or Go language's [url.QueryEscape](https://golang.org/pkg/net/url/#QueryEscape) function to URI-encode the parameters. Other languages provide similar functions to URI-encode special characters.
</Tip>

<Note>
  You can disable the use of implicit credentials when accessing external cloud storage services for various operations by using the <InternalLink path="cockroach-start#security">`--external-io-disable-implicit-credentials` flag</InternalLink>.
</Note>

<sup>1</sup> The file system backup location on the NFS drive is relative to the path specified by the <InternalLink path="cockroach-start">`--external-io-dir`</InternalLink> flag set while <InternalLink path="cockroach-start">starting the node</InternalLink>. If the flag is set to `disabled`, then imports from local directories and NFS drives are disabled.

<sup>2</sup>   Using a `nodeID` is required and the data files will be in the `extern` directory of the specified node. In most cases (including single-node clusters), using `nodelocal://1/<path` is sufficient. If every node has the <InternalLink path="cockroach-start">`--external-io-dir`</InternalLink> flag pointed to a common NFS mount, or other form of network-backed, shared, or synchronized storage, you can use the word `self` instead of a node ID to indicate that each node should write individual data files to its own `extern` directory.

<sup>3</sup> The `AWS_REGION` parameter is optional since it is not a required parameter for most S3-compatible services. Specify the parameter only if your S3-compatible service requires it.

### Example file URLs

You can test the connection from each node in the cluster to your external storage with the <InternalLink path="check-external-connection">`CHECK EXTERNAL CONNECTION`</InternalLink> statement.

Example URLs for <InternalLink path="backup">`BACKUP`</InternalLink>, <InternalLink path="restore">`RESTORE`</InternalLink>,  or <InternalLink path="export">`EXPORT`</InternalLink> given a bucket or container name of `acme-co` and an `employees` subdirectory:

| Location             | Example                                                                                                                                                                       |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Amazon S3            | `s3://acme-co/employees?AWS_ACCESS_KEY_ID=123&AWS_SECRET_ACCESS_KEY=456`                                                                                                      |
| Azure Blob Storage   | `azure-blob://acme-co/employees?AUTH=specified&AZURE_ACCOUNT_NAME={account name}&AZURE_CLIENT_ID={client ID}&AZURE_CLIENT_SECRET={client secret}&AZURE_TENANT_ID={tenant ID}` |
| Google Cloud Storage | `gs://acme-co/employees?AUTH=specified&CREDENTIALS=encoded-123`                                                                                                               |
| NFS/Local            | `nodelocal://1/path/employees`                                                                                                                                                |

For detail on forming the URLs and the different authentication methods, refer to the <InternalLink path="cloud-storage-authentication">Cloud Storage Authentication</InternalLink> page.

Example URLs for <InternalLink path="import-into">`IMPORT INTO`</InternalLink> and given a bucket or container name of `acme-co` and a filename of `employees`:

| Location             | Example                                                                                                                                                                           |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Amazon S3            | `s3://acme-co/employees.sql?AWS_ACCESS_KEY_ID=123&AWS_SECRET_ACCESS_KEY=456`                                                                                                      |
| Azure Blob Storage   | `azure-blob://acme-co/employees.sql?AUTH=specified&AZURE_ACCOUNT_NAME={account name}&AZURE_CLIENT_ID={client ID}&AZURE_CLIENT_SECRET={client secret}&AZURE_TENANT_ID={tenant ID}` |
| Google Cloud Storage | `gs://acme-co/employees.sql?AUTH=specified&CREDENTIALS=encoded-123`                                                                                                               |
| HTTP                 | `http://localhost:8080/employees.sql`                                                                                                                                             |
| NFS/Local            | `nodelocal://1/path/employees`                                                                                                                                                    |

Example URLs for <InternalLink path="create-changefeed">`CREATE CHANGEFEED`</InternalLink>:

| Location           | Example                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Amazon S3          | `'s3://{BUCKET NAME}/{PATH}?AWS_ACCESS_KEY_ID={KEY ID}&AWS_SECRET_ACCESS_KEY={SECRET ACCESS KEY}'`                                                                                                                                                                                                                                                                                                                 |
| Azure Blob Storage | `'azure://{CONTAINER NAME}/{PATH}?AZURE_ACCOUNT_NAME={ACCOUNT NAME}&AZURE_ACCOUNT_KEY={URL-ENCODED KEY}'`                                                                                                                                                                                                                                                                                                          |
| Google Cloud       | `'gs://{BUCKET NAME}/{PATH}?AUTH=specified&CREDENTIALS={ENCODED KEY}'`                                                                                                                                                                                                                                                                                                                                             |
| HTTP               | `'file-http(s)://localhost:8080/{PATH}'` or `'http(s)://localhost:8080/{PATH}'`<br /><br />**Note:** Using `http(s)` without the `file-` prefix is deprecated as a <InternalLink path="changefeed-sinks">changefeed sink</InternalLink> scheme. There is continued support for `http(s)`, but it will be removed in a future release. We recommend implementing the `file-http(s)` scheme for changefeed messages. |

<Note>
  HTTP storage can only be used for <InternalLink path="import-into">`IMPORT INTO`</InternalLink> and <InternalLink path="create-changefeed">`CREATE CHANGEFEED`</InternalLink>.
</Note>

## Encryption

[Transport Layer Security (TLS)](https://wikipedia.org/wiki/Transport_Layer_Security) is used for encryption in transit when transmitting data to or from Amazon S3, Google Cloud Storage, and Azure.

For encryption at rest, if your cloud provider offers transparent data encryption, you can use that to ensure that your backups are not stored on disk in cleartext.

* [Amazon S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html)
* [Azure Blob Storage](https://docs.microsoft.com/azure/storage/common/storage-service-encryption#about-azure-storage-encryption)
* [Google Cloud Storage](https://cloud.google.com/storage/docs/encryption)

CockroachDB also provides client-side encryption of backup data, for more information, see <InternalLink path="take-and-restore-encrypted-backups">Take and Restore Encrypted Backups</InternalLink>.

## Storage permissions

This section describes the minimum permissions required to run CockroachDB operations. While we provide the required permissions for Amazon S3 and Google Cloud Storage, the provider's documentation provides detail on the setup process and different options regarding access management.

Depending on the actions an operation performs, it will require different access permissions to a cloud storage bucket.

This table outlines the actions that each operation performs against the storage bucket:

| Operation                                                                    | Permission                                                                                                                                                                                                                                                                                        | Description                                                                                                                                                    |
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <InternalLink path="backup">Backup</InternalLink>                            | Write                                                                                                                                                                                                                                                                                             | Backups write the backup data to the bucket/container. During a backup job, a `BACKUP CHECKPOINT` file will be written that tracks the progress of the backup. |
| Get                                                                          | Backups need get access after a <InternalLink path="pause-job">pause</InternalLink> to read the checkpoint files on <InternalLink path="resume-job">resume</InternalLink>.                                                                                                                        |                                                                                                                                                                |
| List                                                                         | Backups need list access to the files already in the bucket. For example, `BACKUP` uses list to find previously taken backups when executing an incremental backup and to find the latest checkpoint file.                                                                                        |                                                                                                                                                                |
| Delete (optional)                                                            | To clean up `BACKUP CHECKPOINT` files that the backup job has written, you need to also include a delete permission in your bucket policy (e.g., `s3:DeleteObject`). However, delete is **not** necessary for backups to complete successfully in v22.1 and later.                                |                                                                                                                                                                |
| <InternalLink path="restore">Restore</InternalLink>                          | Get                                                                                                                                                                                                                                                                                               | Restores need access to retrieve files from the backup. Restore also requires access to the `LATEST` file in order to read the latest available backup.        |
| List                                                                         | Restores need list access to the files already in the bucket to find other backups in the [backup collection](take-full-and-incremental-backups.html#backup-collections). This contains metadata files that describe the backup, the `LATEST` file, and other versioned subdirectories and files. |                                                                                                                                                                |
| <InternalLink path="import-into">Import</InternalLink>                       | Get                                                                                                                                                                                                                                                                                               | Imports read the requested file(s) from the storage bucket.                                                                                                    |
| <InternalLink path="export">Export</InternalLink>                            | Write                                                                                                                                                                                                                                                                                             | Exports need write access to the storage bucket to create individual export file(s) from the exported data.                                                    |
| <InternalLink path="create-changefeed">Enterprise changefeeds</InternalLink> | Write                                                                                                                                                                                                                                                                                             | Changefeeds will write files to the storage bucket that contain row changes and resolved timestamps.                                                           |

<Tabs>
  <Tab title="Amazon S3">
    These [actions](https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations_Amazon_Simple_Storage_Service.html) are the minimum access permissions to be set in an Amazon S3 bucket policy:

    | Operation              | S3 permission                                   |
    | ---------------------- | ----------------------------------------------- |
    | Backup                 | `s3:PutObject`, `s3:GetObject`, `s3:ListBucket` |
    | Restore                | `s3:GetObject`, `s3:ListBucket`                 |
    | Import                 | `s3:GetObject`                                  |
    | Export                 | `s3:PutObject`                                  |
    | Enterprise Changefeeds | `s3:PutObject`                                  |

    See [Policies and Permissions in Amazon S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html) for detail on setting policies and permissions in Amazon S3.

    An example S3 bucket policy for a **backup**:

    ```json theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
    {
        "Version": "2012-10-17",
        "Id": "Example_Policy",
        "Statement": [
            {
                "Sid": "ExampleStatement01",
                "Effect": "Allow",
                "Principal": {
                    "AWS": "arn:aws:iam::{ACCOUNT_ID}:user/{USER}"
                },
                "Action": [
                    "s3:PutObject",
                    "s3:GetObject",
                    "s3:ListBucket"
                ],
                "Resource": [
                    "arn:aws:s3:::{BUCKET_NAME}",
                    "arn:aws:s3:::{BUCKET_NAME}/*"
                ]
            }
        ]
    }
    ```
  </Tab>

  <Tab title="Google Cloud Storage">
    In Google Cloud Storage, you can grant users roles that define their access level to the storage bucket. For the purposes of running CockroachDB operations to your bucket, the following table lists the permissions that represent the minimum level required for each operation. GCS provides different levels of granularity for defining the roles in which these permissions reside. You can assign roles that already have these [permissions](https://cloud.google.com/storage/docs/access-control/iam-permissions) configured, or make your own custom roles that include these permissions.

    For more detail about Predefined, Basic, and Custom roles, see [IAM roles for Cloud Storage](https://cloud.google.com/storage/docs/access-control/iam-roles).

    | Operation   | GCS Permission                                                          |
    | ----------- | ----------------------------------------------------------------------- |
    | Backup      | `storage.objects.create`, `storage.objects.get`, `storage.objects.list` |
    | Restore     | `storage.objects.get`, `storage.objects.list`                           |
    | Import      | `storage.objects.get`                                                   |
    | Export      | `storage.objects.create`                                                |
    | Changefeeds | `storage.objects.create`                                                |

    For guidance on adding a user to a bucket's policy, see [Add a principal to a bucket-level policy](https://cloud.google.com/storage/docs/access-control/using-iam-permissions#bucket-add).
  </Tab>
</Tabs>

## Additional cloud storage feature support

### Immutable storage

To complete a backup successfully, `BACKUP` requires <InternalLink path="backup#required-privileges">read and write permissions</InternalLink> to cloud storage buckets. Delete and overwrite permissions are **not** required. As a result, you can write backups to cloud storage buckets with object locking enabled. This allows you to store backup data using a *write-once-read-many (WORM)* model, which refers to storage that prevents any kind of deletion, encryption or modification to the objects once written.

<Note>
  We recommend enabling object locking in cloud storage buckets to protect the validity of a backup for restores.
</Note>

For specific cloud-storage provider documentation, see the following:

* [AWS S3 Object Lock](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html)
* [Retention policies and Bucket Lock in Google Cloud Storage](https://cloud.google.com/storage/docs/bucket-lock)
* [Immutable storage in Azure Storage](https://docs.microsoft.com/azure/storage/blobs/immutable-storage-overview)

### Amazon S3 storage classes

When storing objects in Amazon S3 buckets during <InternalLink path="take-full-and-incremental-backups">backups</InternalLink>, <InternalLink path="export">exports</InternalLink>, and <InternalLink path="change-data-capture-overview">changefeeds</InternalLink>, you can specify the `S3_STORAGE_CLASS={class}` parameter in the URI to configure a storage class type.

The following S3 connection URI uses the `INTELLIGENT_TIERING` storage class:

```
's3://{BUCKET NAME}?AWS_ACCESS_KEY_ID={KEY ID}&AWS_SECRET_ACCESS_KEY={SECRET ACCESS KEY}&S3_STORAGE_CLASS=INTELLIGENT_TIERING'
```

While Cockroach Labs supports configuring an AWS storage class, we only test against S3 Standard. We recommend implementing your own testing with other storage classes.

#### Incremental backups and archive storage classes

<InternalLink path="take-full-and-incremental-backups#incremental-backups">Incremental backups</InternalLink> are **not** compatible with the [S3 Glacier Flexible Retrieval or Glacier Deep Archive storage classes](https://docs.aws.amazon.com/AmazonS3/latest/userguide//storage-class-intro.html#sc-glacier). Incremental backups require the reading of previous backups on an ad-hoc basis, which is not possible with backup files already in Glacier Flexible Retrieval or Glacier Deep Archive. This is because these storage classes do not allow immediate access to an S3 object without first restoring the archived object to its S3 bucket.

Refer to the AWS documentation on [Restoring an archived object](https://docs.aws.amazon.com/AmazonS3/latest/userguide/restoring-objects.html) for steps.

When you are restoring archived backup files from Glacier Flexible Retrieval or Glacier Deep Archive back to an S3 bucket, you must restore both the full backup and incremental backup layers for that backup. By default, CockroachDB stores the incremental backup layers in a separate top-level directory at the backup's storage location. Refer to <InternalLink path="take-full-and-incremental-backups#backup-collections">Backup collections</InternalLink> for detail on the backup directory structure at its storage location.

Once you have restored all layers of a backup's archived files back to its S3 bucket, you can then <InternalLink path="restore">restore</InternalLink> the backup to your CockroachDB cluster.

#### Supported storage classes

This table lists the valid CockroachDB parameters that map to an S3 storage class:

| CockroachDB parameter | AWS S3 storage class                                                                                                                                               |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `STANDARD`            | [S3 Standard](https://aws.amazon.com/s3/storage-classes/#General_purpose)                                                                                          |
| `REDUCED_REDUNDANCY`  | [Reduced redundancy](https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html) **Note**: Amazon recommends against using this storage class. |
| `STANDARD_IA`         | [Standard Infrequent Access](https://aws.amazon.com/s3/storage-classes/#Infrequent_access)                                                                         |
| `ONEZONE_IA`          | [One Zone Infrequent Access](https://aws.amazon.com/s3/storage-classes/#__)                                                                                        |
| `INTELLIGENT_TIERING` | [Intelligent Tiering](https://aws.amazon.com/s3/storage-classes/#Unknown_or_changing_access)                                                                       |
| `GLACIER`             | [Glacier Flexible Retrieval](https://aws.amazon.com/s3/storage-classes/#Flexible_Retrieval)                                                                        |
| `DEEP_ARCHIVE`        | [Glacier Deep Archive](https://aws.amazon.com/s3/storage-classes/#____)                                                                                            |
| `OUTPOSTS`            | [Outpost](https://aws.amazon.com/s3/storage-classes/#S3_on_Outposts)                                                                                               |
| `GLACIER_IR`          | [Glacier Instant Retrieval](https://aws.amazon.com/s3/storage-classes/#Instant_Retrieval)                                                                          |

You can view an object's storage class in the [Amazon S3 Console](https://s3.console.aws.amazon.com) from the object's **Properties** tab. Alternatively, use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-objects-v2.html) to list objects in a bucket, which will also display the storage class:

```shell theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
aws s3api list-objects-v2 --bucket {bucket-name}
```

```
{
    "Key": "2022/05/02-180752.65/metadata.sst",
    "LastModified": "2022-05-02T18:07:54+00:00",
    "ETag": "\"c0f499f21d7886e4289d55ccface7527\"",
    "Size": 7865,
    "StorageClass": "STANDARD"
},
    ...

    "Key": "2022-05-06/202205061217256387084640000000000-1b4e610c63535061-1-2-00000000-
users-7.ndjson",
    "LastModified": "2022-05-06T12:17:26+00:00",
    "ETag": "\"c60a013619439bf83c505cb6958b55e2\"",
    "Size": 94596,
    "StorageClass": "INTELLIGENT_TIERING"
},
```

For a specific operation, see the following examples:

* <InternalLink path="backup#back-up-with-an-s3-storage-class">Back up with an S3 storage class</InternalLink>
* <InternalLink path="create-changefeed#create-a-changefeed-with-an-s3-storage-class">Create a changefeed with an S3 storage class</InternalLink>
* <InternalLink path="export#export-tabular-data-with-an-s3-storage-class">Export tabular data with an S3 storage class</InternalLink>

## See also

* <InternalLink path="backup">`BACKUP`</InternalLink>
* <InternalLink path="restore">`RESTORE`</InternalLink>
* <InternalLink path="import-into">`IMPORT INTO`</InternalLink>
* <InternalLink path="export">`EXPORT`</InternalLink>
* <InternalLink path="create-changefeed">`CREATE CHANGEFEED`</InternalLink>
* <InternalLink path="cluster-settings">Cluster Settings</InternalLink>
