# Create storage buckets

### Create 2 storage buckets

GoTo: Cloud Storage > buckets > create ([link](https://console.cloud.google.com/storage/create-bucket))

1. Create a publicly accessible bucket for facility images:
   1. Name: **\<prefix>-care-facility**
   2. Location type: **Region**
   3. Location: **asia-south1 (Mumbai)**
   4. Default storage class: **Standard**
   5. Public access prevention: **Off**
   6. Access control: **Uniform**
   7. Protection tools: **None**
2. Create a private bucket for patient data.
   1. Name: **\<prefix>-care-patient-data**
   2. Location type: **Region**
   3. Location: **asia-south1 (Mumbai)**
   4. Default storage class: **Standard**
   5. Public access prevention: **On**
   6. Access control: **Uniform**
   7. Protection tools: Retention policy: **7 days**

### Setup access keys

Go to Cloud Storage > Settings > Interoperability ([link](https://console.cloud.google.com/storage/settings;tab=interoperability))&#x20;

1. Under Access keys for service accounts, click on Create a key for a service account
2. Click create a new service account:
   1. Name: **care-bucket-access**
   2. Click “Create and continue”
   3. Role: Storage Object Admin under Cloud Storage
   4. Click "Continue" then "Done"
3. Select **care-bucket-access** and click on create key
4. Note down the Access key and Secret for later

### Configure CORS:

1. Activate Cloud Shell
2. Create a file bucket-config.json with the following contents

```json
[
   {
     "origin": ["https://care.ohc.network", "https://care.coronasafe.in"],
     "method": ["GET", "PUT"],
     "responseHeader": ["*"],
     "maxAgeSeconds": 3600
   }
]
```

3. Replace the origin with your deployed frontend URLs
4. Apply config for buckets using gcloud cli

{% code overflow="wrap" %}

```bash
gcloud storage buckets update gs://<prefix>-care-facility --cors-file=bucket-config.json
```

{% endcode %}

{% code overflow="wrap" %}

```bash
gcloud storage buckets update gs://<prefix>-care-patient-data --cors-file=bucket-config.json
```

{% endcode %}


---

# 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://deploydocs.coronasafe.network/cloud-deployment-overview/google-cloud-deployment/create-storage-buckets.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.
