- A.
Use S3 Event Notifications to validate the file upload and download requests and update the user interface (UI).
- B.
Save the details of the uploaded files in a separate Amazon DynamoDB table. Filter the list of files in the user interface (UI) by comparing the current user ID with the user ID associated with the file in the table.
- C.
Use Amazon API Gateway and an AWS Lambda function to upload and download files. Validate each request in the Lambda function before performing the requested operation.
- D.
Use an IAM policy within the Amazon Cognito identity prefix to restrict users to use their own folders in Amazon S3.
答案: D
Option D is the correct answer because it utilizes the IAM policies to enforce access control at the granularity of individual user directories within Amazon S3. By attaching these policies to the Cognito identity pools, each user is provided with unique credentials that only allow access to their specific directory, ensuring that users can only upload and download their own files. This approach is secure and does not require additional components like S3 Event Notifications, DynamoDB tables, or Lambda functions, which could introduce more complexity and potential security vulnerabilities.