ExamQuestions.com

Register
Login
AWS Certified Developer Associate Exam Questions

Amazon

AWS Certified Developer Associate

357 / 474

Question 357:

You are developing a Lambda in your Dev1 account, the purpose of this Lambda is to save QR codes in two S3 buckets, one bucket (BucketDev1) is in the same account as the Lambda and the second bucket (BucketDev2) is in other AWS account called Dev2. A requirement is to only allow this specified Lambda from Dev1 to create objects in BucketDev2.
What do you need to grant access to this Lambda function for both S3 buckets?

Answer options:

A.Create a role called S3-Lambda with a policy that allows to create objects in any S3 bucket and attach it to the Lambda, create in BucketDev1 a bucket policy that only allows resources with the S3-Lambda role to write in BucketDev1.
B.Create a role called S3-Lambda with a policy that allows to create objects in any S3 bucket and attach it to the Lambda, create in BucketDev2 a bucket policy that allows resources with the S3-Lambda role from Dev1 account to write in BucketDev2.
C.Create a role called S3-Lambda with a policy that allows you to write in BucketDev1 and BucketDev2 and attach it to the Lambda. Create in BucketDev2 a bucket policy with two statements. The first statement denies all resources with the S3-Lambda role of Dev1 account to write in any S3 bucket, the second statement allows the specified Lambda from Dev1 account to write in the specified bucket in dev2 account.
D.Create two policies, the first one allows Lambda to create objects in BucketDev1 and the second, allows Lambda to create objects in BucketDev2. Create an IAM role with these two policies and attach it to the Lambda.