My Project Flow:
- You go to my website
- You login with Username and Password that admin made
- You got to see your dedicated files, private to your account
I already made the basis with Firebase (Authentication
and Storage
). So in Firebase i made this Storage Rules
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /assets/{userId}/{assetsId} {
allow read;
}
}
}
Ilustration storage:
assets/
|----user01/
| |----user01.jpg
|----user02/
| |----user02.jpg
basically only that user01 can see user01.jpg & only that user02 can access see user02.jpg if he/she login
Problem:
Now, I am currently want try to remake this project on Amazon Web Services (AWS). I am currently using AWS Cognito
which in my understanding is equal to Firebase Authentication
& AWS S3 Storage
which in my understanding is equal to Firebase Storage
.
I am still confuse how to develop with AWS, but i think i already manage how to get the userId
(or sub
i think in AWS Cognito) if the user login
I try to recreate the Firabase Storage Rules
with https://awspolicygen.s3.amazonaws.com/policygen.html for S3 Bucket Policy
but there is no condition like only this userId
(or sub
i think in AWS Cognito) allow to READ his/her private files.
I am new to this Firebase and very new to this AWS things. Please guide me throughly, much appreciated.