AWS Certified Developer – Associate — Question 413

A development team has been using a builder server that is hosted on an Amazon EC2 instance to perform builds and deployments for the last 3 months. The
EC2 instance's instance profile uses an IAM role that contains the Administrator Access managed policy. The development team must replace that policy with a policy that provides only the required permissions.
What is the FASTEST way to create a custom 1AM policy for the EC2 instance to meet this requirement?

Answer options

Correct answer: B

Explanation

Generating a policy based on the actual API actions recorded in AWS CloudTrail over the last 3 months is the fastest and most accurate way to define a least-privilege IAM policy. Option A is too broad because granting access to entire services rather than specific actions does not adhere to least privilege. Option C would block all functionality, while Option D is incorrect because manually querying logs with Amazon Athena is far more time-consuming than utilizing CloudTrail-based policy generation.