Utiliser MinIO managé (stockage objet S3)
Endpoint S3 MinIO, clés d'accès, client mc, créer des buckets et politiques.
Utiliser MinIO managé (S3)
MinIO est un stockage objet compatible S3. L’endpoint, la console web, l’access key et le secret sont dans le panel.
1. Accéder
- Console web MinIO : URL du panel (gestion des buckets via navigateur).
- Endpoint S3 : pour vos applications / clients S3.
2. Client mc (ligne de commande)
mc alias set onesubnet https://<hote> <access_key> <secret_key>
mc ls onesubnet # lister les buckets
mc mb onesubnet/mon-bucket # créer un bucket
mc cp fichier.txt onesubnet/mon-bucket/ # uploader
mc ls onesubnet/mon-bucket # lister le contenu
3. Depuis une application (SDK AWS)
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3"
const s3 = new S3Client({
endpoint: "https://<hote>",
region: "us-east-1",
credentials: { accessKeyId: "<access_key>", secretAccessKey: "<secret>" },
})
await s3.send(new PutObjectCommand({ Bucket: "mon-bucket", Key: "fichier.txt", Body: "data" }))
regionpeut resterus-east-1(MinIO l’ignore), seul l’endpointcompte.
4. Rendre un bucket public (lecture)
mc anonymous set download onesubnet/mon-bucket
Références
- Documentation MinIO : https://min.io/docs/minio/linux/index.html
- Client mc : https://min.io/docs/minio/linux/reference/minio-mc.html