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

# Storage

> Create a Cloud Storage or S3 bucket in your account, and give individual services access to it without keys.

The Storage add-on creates a bucket in your own cloud account: a **Cloud Storage** bucket on Google Cloud or an **S3** bucket on AWS. Services get access to it through their own cloud identity, one service at a time, with no access keys.

## How access works

Inframan creates the bucket, but it can't grant anyone access to it. Granting a bucket to a service's identity is outside the permissions you give Inframan, deliberately. Instead, Inframan generates the commands and you run them with your own credentials, then Inframan verifies the result.

Access is per service and per bucket: two services that write to one bucket need two grants.

```mermaid theme={null}
flowchart LR
  A[Turn on workload identity for the service] --> B[Run the bucket grant]
  B --> C[Verify]
  C --> D[Connect in inframan.yaml]
  D --> E[Deploy]
```

## Give a service access

**1. Create the bucket**

In the **App Store**, choose **Storage**, pick the **Infrastructure** and give it an **Instance name**, for example `uploads`.

**2. Give the service an identity**

The bucket is granted to the service's own cloud identity, so the service needs one first. Open the service, select the **Security** tab and turn on workload identity. See [Workload identity](https://inframan.mintlify.site/secure/workload-identity.md).

**3. Grant the bucket**

Open the service's **Environment** tab and connect it to the bucket. Inframan shows the commands that grant it access:

* **Google Cloud:** two `gcloud` commands, run in Cloud Shell.
* **AWS:** one `aws iam put-role-policy` command naming the bucket, run in AWS CloudShell.

Run them, then verify.

**4. Connect it in inframan.yaml**

```yaml inframan.yaml theme={null}
services:
  api:
    port: 8080
    connections:
      UPLOADS_BUCKET: storage/uploads
```

`UPLOADS_BUCKET` receives the bucket's name. Your code uses the cloud provider's SDK as usual, and the SDK picks up the service's identity by itself.

> [!NOTE]
>
> A connection to a bucket, and any release that uses one, is refused until that service's grant is verified. The bucket's **Access** tab lists every service that has been granted, with its status.


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