# Cloud storage

Fabricates stores uploaded and generated data in cloud storage. You can use either:

* Amazon S3 (or any other Amazon S3-compatible storage)
* Azure Blob Storage
* Google Cloud Storage
* Cloudflare R2
* Backblaze B2

## Identifying the cloud storage platform <a href="#cloud-storage-platform" id="cloud-storage-platform"></a>

To indicate which cloud storage platform to use, in **.env**, set the following environment variable:

```
FABRICATE_BLOCK_STORAGE_SERVICE=("amazon", "azure", or "google")
```

## S3 bucket <a href="#aws-s3-bucket" id="aws-s3-bucket"></a>

To use Amazon S3 to store generated data, in **.env**, set:

```
FABRICATE_BLOCK_STORAGE_SERVICE="amazon"
```

To set up the S3 bucket:

1. Create an S3 bucket in the AWS Region closest to where Fabricate will run.\
   \
   We recommend that you set the bucket name to `fabricate`.
2. To enable Fabricate to upload files to this S3 bucket, either:
   * In **.env**, configure `FABRICATE_AWS_ACCESS_KEY_ID` and `FABRICATE_AWS_SECRET_ACCESS_KEY`.
   * Assign an IAM role to the EC2 instances on which Fabricate runs.\
     The role must be able to write  to the S3 bucket. For information on how to do this, go to [Enable S3 access from EC2 by IAM role](https://cloud-gc.readthedocs.io/en/latest/chapter03_advanced-tutorial/iam-role.html).
3. In `.env`, set:

<pre data-overflow="wrap"><code>FABRICATE_S3_BUCKET=  #name of the S3 bucket
<strong>FABRICATE_AWS_REGION=  # AWS Region where the S3 bucket is located.
</strong><strong>                       # Also used when the Claude LLM provider is Amazon Bedrock.
</strong><strong>
</strong><strong># Either set these or assign an IAM role to the Fabricate EC2 instances
</strong><strong>FABRICATE_AWS_ACCESS_KEY_ID=  # Access key for the AWS account
</strong>FABRICATE_AWS_SECRET_ACCESS_KEY=  # Secret access key for the AWS account
</code></pre>

## Azure Blob Storage

To use Azure Blob Storage to store generated data, in `.env`, set:

```
FABRICATE_BLOCK_STORAGE_SERVICE="azure"
```

To configure the storage location and credentials, set:

```
FABRICATE_AZURE_STORAGE_ACCOUNT_NAME=  # Name of the Azure account
FABRICATE_AZURE_STORAGE_ACCESS_KEY=  # Access key for the Azure account
FABRICATE_AZURE_STORAGE_CONTAINER=  # Path to the Azure storage container to use
```

## Google Cloud Storage

To use Google Cloud Storage to store generated data, in `.env`, set:

```
FABRICATE_BLOCK_STORAGE_SERVICE="google"
```

To configure the storage location and credentials, set:

```
FABRICATE_GCS_PROJECT=  # Name of the Google Cloud Storage project to use
FABRICATE_GCS_CREDENTIALS=  # Credentials to connect to the project
FABRICATE_GCS_BUCKET=  # Name of the bucket to use within the project
```


---

# 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.tonic.ai/fabricate/self-hosting-fabricate/configuring-fabricate/cloud-storage.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.
