Courseiva
Security and CompliancehardMultiple ChoiceObjective-mapped

SOA-C02 Security and Compliance Practice Question

A company uses IAM roles to grant EC2 instances access to S3 buckets. After a recent security audit, the SysOps administrator must ensure that only instances with a specific tag (Environment=Production) can assume the role. How can this be achieved?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Add a condition in the role's trust policy that checks for the instance's tag using the aws:ResourceTag condition key.

IAM role trust policies can use the aws:ResourceTag condition key to restrict which EC2 instances (based on their tags) can assume the role. Option A is wrong because tags are not automatically included in the session; the trust policy must explicitly check tags. Option B is wrong because SCPs apply to accounts, not instances. Option C is wrong because instance profiles cannot be modified to check tags.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Create a new IAM role for each instance and attach the tag.

    Why it's wrong here

    This is not scalable and does not enforce the tag requirement.

  • Use a service control policy (SCP) to deny the ec2:AssumeRole action for instances without the required tag.

    Why it's wrong here

    SCPs apply to accounts, not to EC2 instances.

  • Modify the instance profile to include the tag requirement.

    Why it's wrong here

    Instance profiles do not support tag-based conditions.

  • Add a condition in the role's trust policy that checks for the instance's tag using the aws:ResourceTag condition key.

    Why this is correct

    The trust policy can evaluate the instance's tags at the time of AssumeRole.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

One of 247 original SOA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SOA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SOA-C02 exam.