AWS Certified Solutions Architect Associate · Free Practice Question Medium

Question 58

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?
  • A Apply an S3 bucket policy that grants read access to the S3 bucket.
  • B Embed an access key and a secret key in the Lambda function’s code to grant the required IAM permissions for read access to the S3 bucket.
  • C Apply an IAM role to the Lambda function. Apply an IAM policy to the role to grant read access to all S3 buckets in the account.
  • D Apply an IAM role to the Lambda function. Apply an IAM policy to the role to grant read access to the S3 bucket.
Reveal correct answer

Correct answer: C

Explanation

The most secure solution for granting an AWS Lambda function read access to an Amazon S3 bucket within the same AWS account is to apply an IAM role to the Lambda function and attach an IAM policy to that role, specifically granting read access to the required S3 bucket. This approach ensures that the Lambda function has the necessary permissions without exposing sensitive credentials or granting excessive access.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need