I read many, many posts that relate to what, in my opinion, should be a very common precedent - but not finding exactly what I want, or the simple reason why this is not possible.
I have files on S3. I want to give certain users access to certain files through the interface that I create.
So far I have worked like this:
- I built the interface in Django using its built-in users and groups.
- I have a model for buckets in which I reflect my S3 buckets.
- I have m2m relation from groups to buckets representing S3 permissions.
- A user logs in and authenticates Django users.
- I retrieve from Django a list of buckets that the user is allowed to see
- I use boto to grab a list of file links from these buckets and display to the user.
It works, but not perfect, and just doesn't seem right. I need to keep the bucket mirror, and I also have to maintain my own list of users / passwords and permissions when AWS already has everything built in.
I really want to just create users in IAM and use group permissions in IAM to control access to S3 buckets. No duplication of data or features. My application will ask the UN / PW user and use it to connect to IAM / S3 to pull out a list of buckets and files, and then display links to the user. Plain.
How can I, or why can't I?
Am I considering this wrong?
What is the βrightβ way to solve this (I guess) a very common use case?
source share