Skip to main content

Create a bucket

Buckets are the top-level containers for your objects. This guide shows three methods: Cloud-Panel, CLI and Terraform.

Prerequisites

Naming conventions

  • 3–63 characters; lower-case letters, numbers and hyphens only
  • Must begin and end with a letter or a number
  • Must be unique within the region
  • DNS-compliant (the name becomes part of the URL: https://Bucketname.s3.internet1.de)

Variant 1: Cloud-Panel

  1. In the Cloud-Panel, scroll down a little further to the Create Object Storage section; clicking on it will redirect you to your ccenter area.
  2. Now select S3 Storage on the left, followed by S3 User
  3. To proceed with creating a bucket, a user Account must be set up in the Account overview.
  4. A user access can be created automatically simply by clicking on Create Account. Please make sure you save the information from the banner that appears after creation – it contains, amongst other things, the key pair that has been generated for your access. Copy the Secret Key immediately and store it in a secure place (e.g. a password manager).
Secret Key is only displayed once

Once the dialogue box has been closed, the secret key cannot be viewed again. If it is lost, a new key pair must be generated.

  1. Clicking the ›Edit‹ button next to your user Account opens a Control Panel, which allows you to generate a new key pair and create additional buckets.
  2. To create further buckets, click Add bucket on the right after you have entered a bucket name (e.g. test-5687test).

Option 2: CLI

# AWS CLI
aws s3 mb s3://mein-bucket --endpoint-url https://s3.internet1.de

# MinIO Client
mc mb centron/mein-bucket

# Mit aktiviertem Object Lock (nur bei Erstellung möglich)
aws s3api create-bucket --bucket mein-lock-bucket \
--object-lock-enabled-for-bucket \
--endpoint-url https://s3.internet1.de

Check success:

aws s3 ls --endpoint-url https://s3.internet1.de

Option 3: Terraform (MinIO provider)

As the object storage is S3-compatible, buckets can be managed declaratively using the MinIO Terraform Provider.

terraform {
required_providers {
minio = {
source = "aminueza/minio"
version = "~> 3.0"
}
}
}

provider "minio" {
minio_server = "s3.centron.de"
minio_region = " "
minio_user = var.access_key # Access Key
minio_password = var.secret_key # Secret Key
minio_ssl = true
}

resource "minio_s3_bucket" "backup" {
bucket = "mein-backup-bucket"
acl = "private"
}

# Optional: Versioning aktivieren
resource "minio_s3_bucket_versioning" "backup" {
bucket = minio_s3_bucket.backup.bucket
versioning_configuration {
status = "Enabled"
}
}
terraform init
terraform plan
terraform apply
Passing on Login details securely

Do not hard-code the access key or secret key; instead, pass them via variables or environment variables (TF_VAR_access_key, TF_VAR_secret_key).

Delete bucket

A bucket must be completely empty – including all object versions, delete markers and pending multipart uploads:

# Inhalt inkl. aller Objekte entfernen, dann Bucket löschen
aws s3 rm s3://mein-bucket --recursive --endpoint-url https://s3.internet1.de
aws s3 rb s3://mein-bucket --endpoint-url https://s3.internet1.de

When versioning is enabled, versions and delete markers must be deleted separately (e.g. using aws s3api delete-objects, followed by list-object-versions).

Next steps