Security and Compliance

A company tags IAM roles and EC2 instances with Project values and wants one reusable policy that permits starting instances only within the caller's project. Which policy condition implements this requirement?

Show the answer

Correct answerB. Compare aws:ResourceTag/Project with aws:PrincipalTag/Project.

AWhy not this: Account matching does not distinguish projects that share an AWS account.

BWhy this is right: Matching the instance's Project tag to the role's Project tag enforces project-specific access.

CWhy not this: Region matching restricts location, not access according to project membership.

DWhy not this: A role allowlist does not associate each caller with instances bearing its Project value.

Matching resource and principal Project tags implements attribute-based authorization with a reusable policy. An approved role ARN list identifies callers but does not dynamically match each caller to instances belonging to its project.