Using Google Cloud Storage with MinIO Client

Akanksha Verma
Google Cloud - Community
3 min readDec 20, 2022

MinIO is an open-source software defined object storage service used by developers and enterprises worldwide. With the advent of multi-cloud, a layer of abstraction exposed as a local directory can be quite helpful to manage the interfaces between your applications and the various cloud object storages used by it — think Google Cloud Storage, Amazon S3, Azure Blob Storage, and the likes .

In this article, I will show you how to interface your MinIO Client applications with Google Cloud Storage in 3 easy steps! Google Cloud Storage has an excellent Interoperability API that allows you to seamlessly interface Google Cloud Storage with Client Libraries, SDKs, or any S3 compatible API. Without much further ado, let us dive right in and find out how to get started!

Here’s how :

> Create a Service Account with an appropriate role assigned to it (Think of what kind of access does your application need to the storage bucket? Example: would your application only read files in the bucket, or write too?)

> Create HMAC keys (Cloud Storage -> Settings -> Interoperability) by clicking on ‘Create a key for a Service Account’ and then proceed to select the Service Account you created in the previous step :

[ Read more about HMAC keys and best practices here: https://cloud.google.com/storage/docs/authentication/hmackeys ]

Once HMAC key creation is complete, download and store the ‘Access Key’ & ‘Secret’ securely.

Also, keep a note of the endpoint (‘Storage URI’) to be used for Google Cloud Storage at Cloud Storage -> Settings -> Interoperability :

> Finally, update your application’s source code to allow the MinIO client to connect to Google Cloud Storage using :

endpoint = https://storage.googleapis.com

access_key = Access Key obtained from HMAC Key

secret = Secret obtained from HMAC Key

For example, if your application is coded in Java , you will be using the MinioClient.builder() method as follows:

MinioClient minioClient =
MinioClient.builder()
.endpoint("https://storage.googleapis.com")
.credentials("YOUR_ACCESS_KEY", "YOUR_SECRET_KEY")
.build();

For other clients (Python, Node.js etc) , check out this or the official documentation here .

And.. You’re Done! Your application can now connect with Google Cloud Storage using MinIO client :)

https://www.flickr.com/photos/tom-margie/4049991389

--

--