rissson / terraform-provider-rgw

Mirror for https://gitlab.com/lama-corp/infra/tools/terraform-provider-rgw
MIT License
7 stars 1 forks source link

Feature Request: Manage Buckets #5

Closed torbendury closed 1 year ago

torbendury commented 1 year ago

Hi @rissson,

thank you for creating this Terraform provider.

I would like to be able to also manage buckets created in rgw. Is there any chance of getting this implemented? My Go skills are quite basic so I don't think I'd be of any help.

rissson commented 1 year ago

Hi, thanks for your interest in the project. I haven't implemented this because I wanted to avoid having to maintain stuff you can do with another terraform provider, in this case I used aminueza/minio.

The server where that terraform is running isn't accessible right now, but I'll link to an example when it is.

torbendury commented 1 year ago

That'd be great! I'm currently switching from MinIO to a ceph cluster with rgw, I also used to utilize aminueza/minio provider but it seemed quite unmaintained at some point and for several reasons I wasn't able to update my MinIO cluster to a version needed later on.

But if the API works interchangeable (now that you mention, it should perfectly do so because of S3 API compliance) we should be able to use the MinIO provider.

Were you also able to implement bucket lifecycles etc. with the MinIO provider on rgw buckets?

rissson commented 1 year ago

https://gitlab.cri.epita.fr/cri/iac/infrastructure/-/blob/main/undercloud/terraform/ceph/users.tf#L11

Here's the example I was talking about. At the time I only implemented ACLs, and I can't see anything related to lifecycles, but if the minio provider supports it, then it should work as well, as you said, because S3 API compliance.

torbendury commented 1 year ago

Ah, I see. You create the users via your RGW provider and the rest with the MinIO provider.

A quick follow-up question because I'm either blind or it's not in the example: How did you handle permissions? i.e. user-a should have access to bucket-a (and only to bucket-a!) and user-b should have access to bucket-b.

rissson commented 1 year ago

IIRC bucket-a is created by user-a, which makes user-a owner of bucket-a, and since it's private, they're the only one with access

torbendury commented 1 year ago

Ah, I seem to have understood your module just now. You're handing over user-a to your module call, so he creates bucket-a.

rissson commented 1 year ago

Yes that's it

rissson commented 1 year ago

I'm going to close this. If there's anything else, don't hesitate