A company runs an AWS Lambda function that generates thumbnail images from larger originals. The function needs read and write permissions to an Amazon S3 bucket in the same AWS account. Which options will grant the function the required access? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Create an IAM role for the Lambda function, and attach an IAM policy that grants access to the S3 bucket., Create an IAM role for the Lambda function, and attach a bucket policy to the S3 bucket that allows access. Specify the function’s IAM role as the principal..
Why this is the answer
The correct options leverage IAM roles, which are the recommended and most secure way to grant permissions to AWS services like Lambda. Attaching an IAM policy directly to the Lambda function's execution role grants the necessary S3 permissions. Alternatively, a bucket policy on the S3 bucket can grant access to the Lambda function's IAM role as the principal. Incorrect options: Using IAM user access keys in Lambda environment variables is insecure and not recommended for long-term credentials. EC2 key pairs are for SSH access to EC2 instances, not for granting S3 access to Lambda functions. Security groups control network traffic, not S3 bucket access permissions. S3 bucket policies do not use security group IDs for access control.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed