Mastering MinIO: Using Terraform to manage IAM Users and S3 buckets
Tags: devops, go, terraform, minio
Published: 2020-03-01 23:46:18

In the middle-age of Internet Era, an ancient IT professional, widely known as _sysadmin_, fearful used to deploy and manage infrastructure manually. The darkest time would be worst when Darth Vader decides to take a time off from the Death Star (aka vacation) and leaves the control under the Stormtroopers team with no documentation. One mistake and the Death Star was destroyed: server misconfigured, slow deployments and recurring downtimes. It would be almost funny if it weren't so sad. However, thanks to the DevOps Revolution, it has been changing.

Besides a new **cloudish era** has begun, building production-ready environments are hard, stressful and require time. Even though your company is cutting-edge modern solutions - Docker, Kubernetes, S3 buckets, microservices, machine learning, etc. - mastering high scalability is quite complicated. To save DevOps/Developers teams from the dark side,  [Infrastructure as Code (IaC)](https://www.hashicorp.com/resources/what-is-infrastructure-as-code)  has emerged alongside the DevOps workflow, pledging itself for managing and provisioning IT infrastructure through script files in an easy way.

There are many tools that perform infrastructure automation capabilities and use IaC. In this case study, we are going to manage  [MinIO buckets and IAM Users](https://min.io/)  using  [Terraform](https://www.terraform.io/).

[![An example of MinIO server](https://media-exp1.licdn.com/dms/image/C4E12AQGS2z5Hl6Oteg/article-inline_image-shrink_1500_2232/0?e=1588809600&v=beta&t=hx_XjDA5aww5OjFJ9o9CwOBxuLPznkpUyZ4gRrA5hn4)](http://play.minio.io:9000/)

MinIO Simple Storage Service (S3) is high-performance Kubernetes-friendly object storage, compatible with Amazon S3 and 100% open source. MinIO can run in on-premise servers or even better; you can run it locally using  [Docker](https://hub.docker.com/r/minio/minio/). It means MinIO is free of charge and you don't have to sign up for anything. MinIO is a key for those companies which have dedicated servers and want to start migrating functionality of their legacy systems to cloud environments.

Although all pros, there is a con in MinIO buckets regards provisioning the Identity and Access Management (IAM): you have to perform users, policies and groups as the darkish way through a client. The  [MinIO mc](https://docs.min.io/docs/minio-client-complete-guide.html)  provides a solution for managing MinIO by UNIX commands like ls, cat, cp, mirror, diff, find etc. It's the hard way, but it gets the job done. Now, you might be asking yourself: What about the benefits of IaC in MinIO buckets? I'm thrilled to announce a new  [Terraform provider for MinIO](https://github.com/aminueza/terraform-provider-minio)  to manage not only S3 buckets but also IAM Users, groups and policies. You no longer need to provisioning, compiling and distributing MinIO resources on your own!

![Não foi fornecido texto alternativo para esta imagem](https://media-exp1.licdn.com/dms/image/C4E12AQHkGf5h4m3VTQ/article-inline_image-shrink_1000_1488/0?e=1588809600&v=beta&t=4vZjgyny0bBGPhWlAzLH2iR1ksZ0fGfIMPXVen1N7a0)

Terraform provider MinIO is an open-source tool written in Golang, responsible for understanding Minio API interactions for the lifecycle of a resource: create, read, update, delete. MinIO provider gives you a visible way for monitoring resources as code and provides similar benefits like automation, visibility, and collaboration.

The full source code of this MinIO provider is available on [GitHub](https://github.com/aminueza/terraform-provider-minio). Everyone is welcome to use and collaborate. We have invested a lot of time and effort into MinIO provider for covering the most of resources and making it friendly to use. However, there are few resources which are under development.  _Plus:_  If you are not familiar with HCL language, HashiCorp has [excellent tutorial resources](https://learn.hashicorp.com/terraform/) you can look into to get the basics of Terraform.

**May the force be with you!**