AWS Certified Developer – Associate (DVA-C02) — Question 162

An application that runs on AWS Lambda requires access to specific highly confidential objects in an Amazon S3 bucket. In accordance with the principle of least privilege, a company grants access to the S3 bucket by using only temporary credentials.

How can a developer configure access to the S3 bucket in the MOST secure way?

Answer options

Correct answer: C

Explanation

The correct answer is C because creating a Lambda function execution role with a policy that grants specific access adheres to the principle of least privilege while avoiding hardcoding credentials. Options A and D are insecure as they involve storing sensitive information directly in code or environment variables, which increases the risk of exposure. Option B, while more secure than A and D, still involves static credentials that could lead to security vulnerabilities if not managed properly.