nerdexam
Amazon

DVA-C02 · Question #285

A company has an application that is hosted on Amazon EC2 instances. The application stores objects in an Amazon S3 bucket and allows users to download objects from the S3 bucket. A developer turns…

The correct answer is A. Create an EC2 instance profile and role with an appropriate policy. Associate the role with the C. Modify the application to use the S3 GeneratePresignedUrl API call. An EC2 instance profile grants the application IAM permissions to call S3, and S3 presigned URLs let the application generate time-limited, authenticated download links for signed-in users.

Submitted by fatema_kw· Mar 5, 2026Security

Question

A company has an application that is hosted on Amazon EC2 instances. The application stores objects in an Amazon S3 bucket and allows users to download objects from the S3 bucket. A developer turns on S3 Block Public Access for the S3 bucket. After this change, users report errors when they attempt to download objects. The developer needs to implement a solution so that only users who are signed in to the application can access objects in the S3 bucket. Which combination of steps will meet these requirements in the MOST secure way? (Choose two.)

Options

  • ACreate an EC2 instance profile and role with an appropriate policy. Associate the role with the
  • BCreate an IAM user with an appropriate policy. Store the access key ID and secret access key on
  • CModify the application to use the S3 GeneratePresignedUrl API call.
  • DModify the application to use the S3 GetObject API call and to return the object handle to the
  • EModify the application to delegate requests to the S3 bucket.

How the community answered

(32 responses)
  • A
    47% (15)
  • B
    6% (2)
  • D
    13% (4)
  • E
    34% (11)

Why each option

An EC2 instance profile grants the application IAM permissions to call S3, and S3 presigned URLs let the application generate time-limited, authenticated download links for signed-in users.

ACreate an EC2 instance profile and role with an appropriate policy. Associate the role with theCorrect

An EC2 instance profile attaches an IAM role to the EC2 fleet, allowing the application to assume AWS credentials via the instance metadata service. This eliminates hardcoded access keys and is the secure, recommended way to grant EC2 applications access to S3.

BCreate an IAM user with an appropriate policy. Store the access key ID and secret access key on

Storing an IAM user's long-lived access key ID and secret access key on the EC2 instance is a security anti-pattern; these credentials can be exposed in the event of an instance compromise and are harder to rotate than instance profile roles.

CModify the application to use the S3 GeneratePresignedUrl API call.Correct

The S3 GeneratePresignedUrl API call uses the application's IAM credentials (from the instance profile) to sign a time-limited URL for a specific object. The application only generates and returns a presigned URL to authenticated users, ensuring that S3 itself remains private while authorized access is granted securely without exposing credentials to the client.

DModify the application to use the S3 GetObject API call and to return the object handle to the

Having the application fetch the S3 object and return it directly to the user routes all object data through the EC2 instance, increasing bandwidth costs, adding latency, and creating a bottleneck compared to presigned URLs which allow direct client-to-S3 transfers.

EModify the application to delegate requests to the S3 bucket.

Delegating requests directly to the S3 bucket without presigned URL signing or IAM-based access control does not define a secure, authenticated access mechanism and is too vague to constitute a complete solution.

Concept tested: EC2 instance profile with S3 presigned URL for secure private object access

Source: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice