
Answer-first summary for fast verification
Answer: Save the S3 key for each user's profile photo in a DynamoDB table and use a lambda function to dynamically generate a pre-signed URL. Reference this URL for display via the web application
"Save the S3 key for each user's profile photo in a DynamoDB table and use a lambda function to dynamically generate a pre-signed URL. Reference this URL for display via the web application" On Amazon S3, all objects by default are private. Only the object owner has permission to access these objects. However, the object owner can optionally share objects with others by creating a pre-signed URL, using their own security credentials, to grant time-limited permission to download the objects. You can also use an IAM instance profile to create a pre-signed URL. When you create a pre-signed URL for your object, you must provide your security credentials, specify a bucket name, an object key, specify the HTTP method (GET to download the object), and expiration date and time. The pre-signed URLs are valid only for the specified duration. So for the given use-case, the object key can be retrieved from the DynamoDB table, and then the application can generate the pre-signed URL using the IAM instance profile.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
As a part of their onboarding process, employees at an IT company are required to upload their profile photos to a private S3 bucket. The company aims to develop an internal web application, hosted on an EC2 instance, to securely display these profile photos when employees mark their attendance.
As a Developer Associate, which of the following solutions would you recommend to fulfill this requirement?
A
Keep each user's profile image encoded in base64 format in an RDS table and reference it from the application for display
B
Save the S3 key for each user's profile photo in a DynamoDB table and use a lambda function to dynamically generate a pre-signed URL. Reference this URL for display via the web application
C
Keep each user's profile image encoded in base64 format in a DynamoDB table and reference it from the application for display
D
Make the S3 bucket public so that the application can reference the image URL for display
No comments yet.