---
title: "Create an S3 bucket and access key"
description: "Order Object Storage, create a bucket and a key, and connect any S3 client."
url: https://www.gyrohosting.com/developers/en/howto/s3-bucket.html
language: en
openapi: https://www.gyrohosting.com/developers/openapi.json
api_version: 2.30.0
---

# Create an S3 bucket and access key

Order Object Storage, create a bucket and a key, and connect any S3 client.


## 1. Order storage

**curl**

```bash
curl -s -X POST https://www.gyrohosting.com/api/v1/client/cloud/storage \
  -H "Authorization: Bearer $GYRO_TOKEN" -H "Content-Type: application/json" -H "Idempotency-Key: $(uuidgen)" \
  -d '{"plan":"standard-250gb","cycle":"monthly","name":"gyro-proje-s3","confirm":true}'
```

**CLI**

```bash
gyro s3 plans
gyro s3 create --plan standard-250gb --cycle monthly --name gyro-proje-s3 --yes
```

**Terraform**

```hcl
resource "gyro_storage" "s3" {
  plan  = "standard-250gb"
  cycle = "monthly"
  name  = "gyro-proje-s3"
}
```


## 2. Bucket and key

**curl**

```bash
curl -s -X POST https://www.gyrohosting.com/api/v1/client/cloud/storage/12345/buckets -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" -d '{"bucket":"assets"}'
curl -s -X POST https://www.gyrohosting.com/api/v1/client/cloud/storage/12345/keys -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" -d '{}'      # secret key is shown once
curl -s https://www.gyrohosting.com/api/v1/client/cloud/storage/12345/connect -H "Authorization: Bearer $GYRO_TOKEN"   # endpoint, region
```

**CLI**

```bash
gyro s3 bucket create 12345 --bucket assets
gyro s3 key create 12345
gyro s3 connect 12345
```

**Terraform**

```hcl
resource "gyro_storage_bucket" "assets" {
  service_id = gyro_storage.s3.service_id
  name       = "assets"
}
resource "gyro_storage_key" "ci" {
  service_id = gyro_storage.s3.service_id
  label      = "ci-uploader"
}
```

Endpoint `https://s3.gyrohosting.com`, region `tr-ist-1`; path-style and virtual-host style both work. Static websites, CORS and object lock have their own endpoints under [Object storage](https://www.gyrohosting.com/developers/en/api/object-storage.md).
