AWS Certified Solutions Architect – Associate (SAA-C02) — Question 489

A company has an AWS Lambda function that needs read access to an Amazon S3 bucket that is located in the same AWS account.
Which solution will meet these requirements in the MOST secure manner?

Answer options

Correct answer: B

Explanation

Assigning an IAM role with a least-privilege IAM policy directly to the Lambda function is the most secure method because it avoids hardcoded credentials and limits access only to the required S3 bucket. Hardcoding access keys (Option C) is a major security risk, while granting access to all S3 buckets (Option D) violates the principle of least privilege. Using an S3 bucket policy alone (Option A) is not the standard or most secure practice for granting internal account permissions to an execution identity like Lambda.