An application uses Amazon Cognito user pools and identity pools and must let users upload and download their own files to Amazon S3 (file sizes 3 KB–300 MB). Files must be handled securely so users can only access their own data. Which option provides the HIGHEST level of security?
Choose an answer
Tap an option to check your answer.
Correct answer: Use an IAM policy scoped to each Cognito identity’s prefix so that users can only access objects in their own S3 folder..
Why this is the answer
The most secure approach is to use an IAM policy scoped to each Cognito identity's prefix. Amazon Cognito identity pools can assign temporary, limited-privilege AWS credentials to authenticated users. By configuring an IAM policy with a Resource element that includes a variable like ${cognito-identity.amazonaws.com:sub}/, you can restrict each user to a specific folder (prefix) in S3. This ensures that users can only access objects within their designated S3 path, enforcing strong isolation and preventing unauthorized access to other users' data directly at the S3 bucket policy level. Incorrect options: S3 Event Notifications are for reacting to S3 events, not for validating access control for uploads/downloads. Storing metadata in DynamoDB and filtering in the UI is a client-side control and can be bypassed, offering weak security. Using API Gateway and Lambda to validate every request adds complexity and overhead, and while it can enforce security, it's less direct and potentially less performant than leveraging S3's native IAM policy capabilities for object-level access control.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed