AWS Certified Developer - Associate (DVA-C03) Practice Questions

AWS Certified Developer - Associate (DVA-C03) exam preparation

AWS Certified Developer - Associate (DVA-C03) practice questions in English: 180 questions with explanations. The mock exam has 65 questions and 130 minutes.

AWS Certified Developer - Associate (DVA-C03) free question 4 / 10 · Domain 2: Security

A service that runs with an IAM role creates presigned URLs for report downloads and asks for an expiration of 7 days. Customers report that the links stop working after a few hours. The links must stay valid for the full 7 days. What should the developer change?

  1. Keep the role credentials and request an expiration that is longer than 7 days to have the role session extended further
  2. Add a bucket policy statement that sets the lifetime of presigned URLs for the report prefix to 7 days
  3. Create the presigned URLs in the Amazon S3 console and request an expiration of up to 7 days
  4. Create the presigned URLs with the access keys of an IAM user and Signature Version 4, and request an expiration of 7 days
Show the answer and explanation

Answer: D

Why this is correct
A presigned URL stays valid for the time that is specified when it is generated, but never longer than the credentials that were used to create it. A URL that is created with IAM role credentials expires when the role session expires, even if a longer expiration time was specified, which explains the links that stop after a few hours. An IAM user's access keys used with Signature Version 4 make URLs that are valid for up to 7 days, and the AWS CLI or an SDK can set that expiration.

Why the other options are wrong
"Keep the role credentials and request an expiration that is longer than 7 days to have the role session extended further" … A presigned URL that is created with role credentials expires when the role session expires, even if a longer expiration time is specified. A longer request does not extend the session.
"Create the presigned URLs in the Amazon S3 console and request an expiration of up to 7 days" … In the console, the expiration time can be set between 1 minute and 12 hours. Only the AWS CLI and the SDKs can set it as high as 7 days.
"Add a bucket policy statement that sets the lifetime of presigned URLs for the report prefix to 7 days" … Presigned URLs grant time-limited access without updating the bucket policy. The lifetime is decided when the URL is generated and by the credentials that signed it, not by a bucket policy.

Key points
Presigned URL lifetime = the shorter of the requested expiry and the signing credentials. IAM user with SigV4: up to 7 days. Console: up to 12 hours.

Go to the AWS Certified Developer - Associate (DVA-C03) practice app (10 free questions; purchase unlocks all questions)

See the full practice set