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

An AWS Lambda function is running in a company’s shared AWS account. The function needs to perform an additional ec2:DescribeInstances action that is directed at the company’s development accounts. A developer must configure the required permissions across the accounts.

How should the developer configure the permissions to adhere to the principle of least privilege?

Answer options

Correct answer: B

Explanation

The correct answer is B because creating an IAM role in the development accounts with the necessary permission and establishing a trust relationship allows the Lambda function in the shared account to assume that role, adhering to the principle of least privilege. Options A and C incorrectly configure the permissions in the shared account, while D does not provide the necessary iam:AssumeRole permissions for the Lambda function to access the role in the development accounts.