Security

Developers must start only EC2 instances whose Project tag matches their own IAM principal's Project tag. Which policy condition provides this control without listing each developer or instance?

Show the answer

Correct answerD. Match aws:ResourceTag/Project to aws:PrincipalTag/Project

AWhy not this: A principal ARN identifies the caller, so matching it to an instance ARN does not establish project membership.

BWhy not this: RequestedRegion identifies the request's AWS Region, not the instance's project.

CWhy not this: SourceAccount helps restrict service-to-service requests and does not compare project membership.

DWhy this is right: Comparing these tag values restricts access to instances assigned to the principal's project.

Comparing resource and principal Project tags implements attribute-based access control and scales without individual ARN lists. Checking the source account does not distinguish projects within the same account.