Can I control WEB (not admin) users access to specific folders on my static S3 website?
I have a very simple S3 website. I would like to allow public access to the root, "css", "javascript" folders, but restrict access to the "account" folder. The account folder has subfolders containing pages that are different for EACH web user. The subfolders are named after each username (i.e. "Bill", "Dave", "Jill", "Heather", etc.). My question is:
- Is this possible?
- Which AWS services should I use?
I have tried AWS Cognito (User Pools) and have my S3 bucket up and running. I just can't figure out how to connect the dots so to speak. All the docs I have read and videos I have watched reference admin users, not simple WEB VIEWERS. I do like Cognito's feature of allowing users to sign up by themselves, but I need to know what I should study to make it all work. I assume in the end I'll need to have a bucket policy that includes: ........ "Resource": [ "arn:aws:s3:::my-bucket-name/${aws:username}/*" ] Am I on the right track? Can I just use Cognito User Pools and a Bucket policy only or do I also need CloudFront, Lambda, other, services as well?
Haven't tried this myself, but this blog may give you pointers on how to accomplish what you are trying - https://aws.amazon.com/blogs/networking-and-content-delivery/authorizationedge-how-to-use-lambdaedge-and-json-web-tokens-to-enhance-web-application-security/
Relevant questions
Can I control WEB (not admin) users access to specific folders on my static S3 website?
asked 13 days agoOAI or not OAI for serving a static website in S3 using CloudFront
asked 3 months agoCloudFront giving access denied to subfolders
asked a year agoStatic website in S3 not working with HTTPS
asked 2 years agoAccess denied error uploading to s3 bucket
asked 6 days agoHow do I share Amazon S3 files with users who don't have AWS Management Console access?
Accepted Answerasked 2 years agoBest way to run a web scraper from my S3 website and save the returned information to a database
asked 3 months agoIs it possible to map an S3 static website to a public static IP address?
Accepted Answerasked 2 years agoDiplay pictures stored in s3 to web page
Accepted Answerasked 3 years agoSet the access permission of objects in S3 buckets
asked 4 months ago