I am developing an app using AWS Amplify where I need to store files. I want to use Cognito Attributes instead of Federated Identity ${cognito-identity.amazonaws.com:sub}. I got Schools, Teachers, and students. I want students to upload files to something like the below
"Resource": "arn:aws:s3:::s3-bucket-name/schools/${principalTag/custom:schoolID}/students/${principalTag/username}/"*
I tried Federated Identity > User Access > Attributes for access control > Use Default Mapping The user can log in but no IAM role is attached to the user.
S3 structure is
s3-bucket-name/
└── schools/
└── school-id-1/
├── teachers/
│ └── teacher-id-1/
└── students/
└── student-id-1/