Terraform provider for the Minio object storage.

terraform-provider-minio

A Terraform provider for Minio, a self-hosted object storage server that is compatible with S3.

Check out the documenation on the Terraform Registry - refaktory/minio for more information and usage examples.

Features

Resources

  • Buckets
    • Create/delete
    • Versioning config
    • Encryption config
    • Replication config
    • Lifecycle config
    • Access rules
  • Users
    • Create/delete
    • Assign policies
    • Assign groups
  • Serviceaccounts
  • Canned policies
  • Groups
    • Create/delete
    • Assign policies
  • Objects
    • [ ] Create files with a given content

Datasources

  • Bucket
  • Canned policy
  • Group
  • User
  • Serviceaccount

Usage

Consult the published documenation on the registry for usage documenation.

Additional examples are available in the ./examples directory.

Local Development

Configure Terraform to use the locally built provider

Add this configuration into $HOME/.terraformrc:

(Notice the trailing /bin in the path)

provider_installation {
  dev_overrides {
    "refaktory-dev/minio" = "/PATH/TO/LOCAL/REPO/bin"
  }

  direct {}
}

Build

Build the provider with make build

Test manually

  • Start a local minio instance in a separate terminal (and keep it running) docker-compose up

  • Use the provider cd ./examples && terraform apply

Deploy

Steps to deploy:

  • make prepare-release
  • git tag v0.X.0
  • git push

Actual publishing is handled by the Github action defined in ./.github/workflows/release.yml.

The module is managed on the Terraform registry at https://registry.terraform.io/publish/provider.

About

Developed by refaktory.

Comments
  • Cannot init terraform@v0.13.6

    Cannot init [email protected]

    Hi, thanks for your provider allowing us to define access & secret keys. I'm having an issue since about one week where I cannot initialize that specific provider as soon as I declare a related resource in my terraform code:

    terraform {
      required_providers {
        aws = {
          source  = "hashicorp/aws"
          version = "~> 2.62"
        }
        ...
        }
        minio = {
          source  = "refaktory/minio"
          version = "0.1.0"
        }
      }
    }
    
    provider "minio" {
      endpoint = "my-tls-minio-domain.tld"
      access_key = "my_access_key_that_allows_access_to_my_s3_buckets"
      secret_key = "my_secret_key_that_allows_access_to_my_s3_buckets"
      ssl = true
    }
    
    resource "minio_user" "some_s3_user_account" {
      access_key = var.s3_user.access_key_id
      secret_key = var.s3_user.secret_access_key
    }
    

    If I remove the minio_user resource, terraform init goes without issue but as soon as it's added back I get this:

    bash-5.0# terraform init
    Initializing modules...
    
    Initializing the backend...
    
    Initializing provider plugins...
    ...
    - Using previously-installed refaktory/minio v0.1.0
    ...
    - Finding latest version of hashicorp/minio...
    
    Error: Failed to install provider
    
    Error while installing hashicorp/minio: provider registry
    registry.terraform.io does not have a provider named
    registry.terraform.io/hashicorp/minio
    

    I removed the .terraform directory to start fresh but I end up with the same result, it just downloads your provider without an issue:

    Initializing the backend...
    
    Successfully configured the backend "s3"! Terraform will automatically
    use this backend unless the backend configuration changes.
    
    Initializing provider plugins...
    - terraform.io/builtin/terraform is built in to Terraform
    - Finding refaktory/minio versions matching "0.1.0"...
    ...
    - Finding latest version of hashicorp/minio...
    ...
    - Installing refaktory/minio v0.1.0...
    - Installing refaktory/minio v0.1.0...
    - Installed refaktory/minio v0.1.0 (self-signed, key ID 6D55AB8B63A0B0C3)
    ...
    

    I tried to give an alias to the minio provider definition and reference it in the minio_user resource without success I don't know why terraform looks for a hashicorp/minio provider whereas I have only yours installed.

  • impossible to import

    impossible to import

    it would be useful to be able to import existing resources:

    resource "minio_bucket" "test" {
      name = "test"
    }
    
    terraform import minio_bucket.test test
    
  • Feature: Bucket lifecycle

    Feature: Bucket lifecycle

    The format chosen is somewhat similar to the one in the AWS terraform provider.

    Example:

    resource "minio_bucket" "xxxx" {
      name = "xxxx"
    
      lifecycle_rule {
        expiration {
          days = 2
        }
      }
    }
    
  • minio_canned_policy order of array shifts on second (further) plan/apply

    minio_canned_policy order of array shifts on second (further) plan/apply

    The resource minio_canned_policy order of Action array shifts on second and further terraform plan forcing replacement of the resource.

    Steps to reproduce:

    1. Create main.tf
    resource "minio_canned_policy" "backups" {
      name = "backups"
    
      policy = <<EOT
    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "s3:ListBucket"
                ],
                "Resource": [
                    "arn:aws:s3:::backups"
                ]
            },
            {
                "Effect": "Allow",
                "Action": [
                    "s3:GetObject",
                    "s3:PutObject",
                    "s3:DeleteObject"
                ],
                "Resource": [
                    "arn:aws:s3:::backups/*"
                ]
            }
        ]
    }
    EOT
    }
    
    
    1. Run terraform plan
      # minio_canned_policy.backups will be created
      + resource "minio_canned_policy" "backups" {
          + id     = (known after apply)
          + name   = "backups"
          + policy = jsonencode(
                {
                  + Statement = [
                      + {
                          + Action   = [
                              + "s3:ListBucket",
                            ]
                          + Effect   = "Allow"
                          + Resource = [
                              + "arn:aws:s3:::backups",
                            ]
                        },
                      + {
                          + Action   = [
                              + "s3:GetObject",
                              + "s3:PutObject",
                              + "s3:DeleteObject",
                            ]
                          + Effect   = "Allow"
                          + Resource = [
                              + "arn:aws:s3:::backups/*",
                            ]
                        },
                    ]
                  + Version   = "2012-10-17"
                }
            )
        }
    
    1. Run terraform apply
    minio_canned_policy.backups: Creation complete after 1s [id=backups]
    
    1. Run terraform plan again (without changing the resource)
      # minio_canned_policy.backups must be replaced
    -/+ resource "minio_canned_policy" "backups" {
          ~ id     = "backups" -> (known after apply)
            name   = "backups"
          ~ policy = jsonencode(
              ~ {
                  ~ Statement = [
                        {
                            Action   = [
                                "s3:ListBucket",
                            ]
                            Effect   = "Allow"
                            Resource = [
                                "arn:aws:s3:::backups",
                            ]
                        },
                      ~ {
                          ~ Action   = [
                              - "s3:DeleteObject",
                                "s3:GetObject",
                                "s3:PutObject",
                              + "s3:DeleteObject",
                            ]
                            # (2 unchanged elements hidden)
                        },
                    ]
                    # (1 unchanged element hidden)
                } # forces replacement
            )
        }
    

    I suppose that this also applies to the Resource array but is not applicable here because it has only one element.

  • Is this project still maintained?

    Is this project still maintained?

    Thanks for putting your time into such a well documented provider.

    Still, is this project maintained? It seems like e.g. the current minio release would not work, when looking at the docker-compose.yml you test with. It's only 1 disk and now etcd, this should block quiet some APIs?

    Using your version, I cannot get the provider up and running, getting connection refused all the time. Using the console port, using localhost:9000 my self here too(non SSL), also using the user created by

        MINIO_ROOT_USER:
        MINIO_ROOT_PASSWORD:
    

    Tried it with your minio/minio:RELEASE.2021-08-20T18-32-01Z and the current minio/minio:RELEASE.2021-11-24T23-19-33Z

    Thanks!

QingStor Object Storage service support for go-storage

go-services-qingstor QingStor Object Storage service support for go-storage. Install go get github.com/minhjh/go-service-qingstor/v3 Usage import ( "

Dec 13, 2021
An encrypted object storage system with unlimited space backed by Telegram.

TGStore An encrypted object storage system with unlimited space backed by Telegram. Please only upload what you really need to upload, don't abuse any

Nov 28, 2022
CSI for S3 compatible SberCloud Object Storage Service

sbercloud-csi-obs CSI for S3 compatible SberCloud Object Storage Service This is a Container Storage Interface (CSI) for S3 (or S3 compatible) storage

Feb 17, 2022
High Performance, Kubernetes Native Object Storage
High Performance, Kubernetes Native Object Storage

MinIO Quickstart Guide MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. It is API compatible with Ama

Jan 2, 2023
A High Performance Object Storage released under Apache License
A High Performance Object Storage released under Apache License

MinIO Quickstart Guide MinIO is a High Performance Object Storage released under Apache License v2.0. It is API compatible with Amazon S3 cloud storag

Sep 30, 2021
TurtleDex is a decentralized cloud storage platform that radically alters the landscape of cloud storage

TurtleDex is a decentralized cloud storage platform that radically alters the landscape of cloud storage. By leveraging smart contracts, client-side encryption, and sophisticated redundancy (via Reed-Solomon codes), TurtleDex allows users to safely store their data with hosts that they do not know or trust.

May 29, 2021
"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Yandex Files

Website | Documentation | Download | Contributing | Changelog | Installation | Forum Rclone Rclone ("rsync for cloud storage") is a command-line progr

Jan 9, 2023
Storj is building a decentralized cloud storage network
Storj is building a decentralized cloud storage network

Ongoing Storj v3 development. Decentralized cloud object storage that is affordable, easy to use, private, and secure.

Jan 8, 2023
tstorage is a lightweight local on-disk storage engine for time-series data
tstorage is a lightweight local on-disk storage engine for time-series data

tstorage is a lightweight local on-disk storage engine for time-series data with a straightforward API. Especially ingestion is massively opt

Jan 1, 2023
SFTPGo - Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support - S3, Google Cloud Storage, Azure Blob

SFTPGo - Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support - S3, Google Cloud Storage, Azure Blob

Jan 4, 2023
Rook is an open source cloud-native storage orchestrator for Kubernetes

Rook is an open source cloud-native storage orchestrator for Kubernetes, providing the platform, framework, and support for a diverse set of storage solutions to natively integrate with cloud-native environments.

Oct 25, 2022
A Redis-compatible server with PostgreSQL storage backend

postgredis A wild idea of having Redis-compatible server with PostgreSQL backend. Getting started As a binary: ./postgredis -addr=:6380 -db=postgres:/

Nov 8, 2021
Void is a zero storage cost large file sharing system.

void void is a zero storage cost large file sharing system. License Copyright © 2021 Changkun Ou. All rights reserved. Unauthorized using, copying, mo

Nov 22, 2021
This is a simple file storage server. User can upload file, delete file and list file on the server.
This is a simple file storage server.  User can upload file,  delete file and list file on the server.

Simple File Storage Server This is a simple file storage server. User can upload file, delete file and list file on the server. If you want to build a

Jan 19, 2022
Perkeep (née Camlistore) is your personal storage system for life: a way of storing, syncing, sharing, modelling and backing up content.

Perkeep is your personal storage system. It's a way to store, sync, share, import, model, and back up content. Keep your stuff for life. For more, see

Dec 26, 2022
s3git: git for Cloud Storage. Distributed Version Control for Data.
s3git: git for Cloud Storage. Distributed Version Control for Data.

s3git: git for Cloud Storage. Distributed Version Control for Data. Create decentralized and versioned repos that scale infinitely to 100s of millions of files. Clone huge PB-scale repos on your local SSD to make changes, commit and push back. Oh yeah, it dedupes too and offers directory versioning.

Dec 27, 2022
Storage Orchestration for Kubernetes

What is Rook? Rook is an open source cloud-native storage orchestrator for Kubernetes, providing the platform, framework, and support for a diverse se

Dec 29, 2022
Cloud-Native distributed storage built on and for Kubernetes
Cloud-Native distributed storage built on and for Kubernetes

Longhorn Build Status Engine: Manager: Instance Manager: Share Manager: Backing Image Manager: UI: Test: Release Status Release Version Type 1.1 1.1.2

Jan 1, 2023
The MinIO Admin Go Client SDK provides APIs to manage MinIO services

Golang Admin Client API Reference The MinIO Admin Golang Client SDK provides APIs to manage MinIO services. This quickstart guide will show you how to

Dec 30, 2022
Terraform-provider-e2e-network - Terraform Provider Scaffolding (Terraform Plugin SDK)

This template repository is built on the Terraform Plugin SDK. The template repository built on the Terraform Plugin Framework can be found at terraform-provider-scaffolding-framework.

Jan 19, 2022