Reputation: 214
Disclaimer: I'm new to AWS.
I have a use case where I need to grant read permissions to an object in an S3 bucket to a list of users. All objects are in the same bucket. I'm using Cognito for user authentication.
I've tried using ACL through Java SDK but had no luck. Also, I don't think IAM is usable here as the users are clients, i.e. they don't have an AWS account.
Any suggestion or correction is welcomed!
Upvotes: 1
Views: 1071
Reputation: 269320
There are several ways to grant access to an object in Amazon S3:
The pre-signed URL works like this:
<img src=.../>
tag).The pre-signed URL can be created in a few lines of code. It can be generated within the app, without requiring a call to AWS.
See: Share an Object with Others - Amazon S3
Upvotes: 1
Reputation: 4104
One way to do it is to set up a backend app that would expose a REST API to your clients. This app can live on an instance or it could be serverless. The BE app will contain the logic for the user rights on S3. The S3 buckets will be private, and only the BE will have access on them.
How to setup a REST API on AWS Elastic Beanstalk (python flask)
https://camillovisini.com/barebone-flask-rest-api-on-aws-elastic-beanstalk/
How to setup a REST API (serverless)
Upvotes: 1