AWS Developer DVA-C02 · Development with AWS Services · medium

A photo-sharing platform stores private user photos in an Amazon S3 bucket (Block Public Access = ON). When an authenticated user clicks 'Upload Avatar (15 MB)' or 'Download Invoice PDF' in the browser, the backend AWS Lambda function should not proxy the 15 MB binary payload through API Gateway (10 MB payload limit). Instead, what should the Lambda function generate and return to the browser so the client can upload or download the object directly to/from Amazon S3 for the next 15 minutes?

Published · Last updated · checked before publication — how we verify questions

Options

  • AMake the S3 bucket public (Principal: "*") for 15 minutes during each PutObject upload
  • BBase64-encode the 15 MB file and pass it through a synchronous API Gateway POST payload
  • CAn Amazon S3 Presigned URL (putObject / getObject) with a 15-minute expiryCorrect answer
  • DAn Amazon DynamoDB Time-to-Live (TTL) epoch attribute on the S3 BucketPolicy resource

Answer: C. An Amazon S3 Presigned URL (putObject / getObject) with a 15-minute expiry

Generating an Amazon S3 Presigned URL (generate_presigned_url / getSignedUrl for putObject or getObject with an expiration like ExpiresIn=900 seconds) grants temporary, time-bounded permission (inheriting the signing IAM role's permissions) for the client browser to upload or download directly to/from S3 while bypassing API Gateway's 10 MB payload limit.

Why the other options are wrong

  • A. Make the S3 bucket public (Principal: "*") for 15 minutes during each PutObject upload — Opening the bucket to the public exposes every user's private files.
  • B. Base64-encode the 15 MB file and pass it through a synchronous API Gateway POST payload — API Gateway has a hard 10 MB maximum payload limit, so a 15 MB payload will fail with 413 Payload Too Large.
  • D. An Amazon DynamoDB Time-to-Live (TTL) epoch attribute on the S3 BucketPolicy resource — DynamoDB TTL expires table items, not temporary S3 object upload URLs.

All Development with AWS Services questions and the topic overview →

AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.