Question 1,271 of 1,748
Identity and Access ManagementmediumMultiple ChoiceObjective-mapped

How to Restrict EC2 Instance Types Using IAM Condition Keys

This SCS-C02 practice question tests your understanding of identity and access management. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Exhibit

Refer to the exhibit.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "ec2:Describe*",
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "ec2:RunInstances",
      "Resource": "arn:aws:ec2:us-east-1:123456789012:instance/*",
      "Condition": {
        "StringEquals": {
          "ec2:InstanceType": "t2.micro"
        }
      }
    }
  ]
}

An IAM user has the policy shown in the exhibit. The user tries to launch an m5.large instance in us-east-1, but gets an 'AccessDenied' error. Why does this happen?

Exhibit

Refer to the exhibit.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "ec2:Describe*",
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "ec2:RunInstances",
      "Resource": "arn:aws:ec2:us-east-1:123456789012:instance/*",
      "Condition": {
        "StringEquals": {
          "ec2:InstanceType": "t2.micro"
        }
      }
    }
  ]
}

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

The policy restricts RunInstances to instance type t2.micro, but the user requested m5.large.

The policy only allows RunInstances for instance type t2.micro, so requesting m5.large results in an AccessDenied error. Option A correctly identifies that the user requested an instance type that is not allowed. Option B is incorrect because the condition StringEquals is correctly applied and the issue is not case sensitivity but the value mismatch. Option C is incorrect because the policy does allow RunInstances for the allowed instance type. Option D is incorrect because the resource ARN is valid for EC2 instances.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • The policy restricts RunInstances to instance type t2.micro, but the user requested m5.large.

    Why this is correct

    Correct. The policy only allows RunInstances for instance type t2.micro, so requesting m5.large results in AccessDenied.

    Related concept

    Read the scenario before looking for a memorised answer.

  • The condition uses StringEquals, which is case-sensitive and the instance type is in the wrong case.

    Why it's wrong here

    Incorrect. While StringEquals is case-sensitive, the issue is not case sensitivity but that the requested instance type is different from the allowed one.

  • The policy does not allow the RunInstances action at all.

    Why it's wrong here

    Incorrect. The policy does allow RunInstances for the allowed instance type, but the user requested a different type.

  • The resource ARN in the policy is incorrect for launching instances.

    Why it's wrong here

    Incorrect. The resource ARN is correct for EC2 instances; the issue is the condition on instance type.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Many certification questions include familiar terms but test a specific constraint. Read the exact wording before choosing an answer that is generally true but wrong for this case.

Detailed technical explanation

How to think about this question

This question should be treated as a scenario, not a definition check. Identify the problem, the constraint and the best action. Then compare each option against those facts.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.
  • Use explanations to understand the rule behind the answer.

TExam Day Tips

  • Underline the problem statement mentally.
  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.

What to study next

Got this wrong? Here's your next step.

Identify which SCS-C02 exam domain this question belongs to, then review the specific concept being tested. Practise related questions in that domain and focus on understanding why each wrong answer is tempting — not just why the correct answer is right.

Related practice questions

Related SCS-C02 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free SCS-C02 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this SCS-C02 question test?

Identity and Access Management — This question tests Identity and Access Management — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: The policy restricts RunInstances to instance type t2.micro, but the user requested m5.large. — The policy only allows RunInstances for instance type t2.micro, so requesting m5.large results in an AccessDenied error. Option A correctly identifies that the user requested an instance type that is not allowed. Option B is incorrect because the condition StringEquals is correctly applied and the issue is not case sensitivity but the value mismatch. Option C is incorrect because the policy does allow RunInstances for the allowed instance type. Option D is incorrect because the resource ARN is valid for EC2 instances.

What should I do if I get this SCS-C02 question wrong?

Identify which SCS-C02 exam domain this question belongs to, then review the specific concept being tested. Practise related questions in that domain and focus on understanding why each wrong answer is tempting — not just why the correct answer is right.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on SCS-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. An IAM user reports that they are unable to launch an EC2 instance in us-east-1. The IAM policy attached to the user allows ec2:RunInstances but with a condition that the instance type must be t2.micro. What could be the reason for the failure?

easy
  • A.The user is trying to launch an instance type other than t2.micro.
  • B.The user has not attached a security group to the instance.
  • C.The IAM policy does not include ec2:RunInstances for us-east-1.
  • D.The user's account has reached the EC2 instance limit.

Why A: Option A is correct because the condition likely specifies 'ec2:InstanceType' equals 't2.micro', so if the user tries to launch any other type, the action is denied. Option B is irrelevant because the policy allows the action. Option C is not a common condition. Option D is unrelated.

Variation 2. A security team notices that an IAM user has permissions to launch EC2 instances but should not have access to certain instance types. Which IAM policy condition key should be used to restrict this?

hard
  • A.ec2:ResourceTag
  • B.ec2:Tenancy
  • C.ec2:InstanceProfile
  • D.ec2:InstanceType

Why D: The ec2:InstanceType condition key allows you to restrict IAM users to launching only specific EC2 instance types (e.g., t2.micro, m5.large) by evaluating the instance type value in the RunInstances API call. This is the correct key to enforce a policy that denies access to certain instance types while permitting others.

Keep practising

More SCS-C02 practice questions

Last reviewed: Jun 20, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This SCS-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 SCS-C02 exam.