Courseiva
Design for New SolutionsmediumMultiple ChoiceObjective-mapped

SAP-C02 Design for New Solutions Practice Question

Exhibit

Refer to the exhibit.
{
  "Parameters": {
    "EnvType": {
      "Type": "String",
      "AllowedValues": ["dev", "prod"],
      "Default": "dev"
    }
  },
  "Conditions": {
    "IsProduction": {"Fn::Equals": [{"Ref": "EnvType"}, "prod"]}
  },
  "Resources": {
    "EC2Instance": {
      "Type": "AWS::EC2::Instance",
      "Properties": {
        "InstanceType": {
          "Fn::If": ["IsProduction", "t3.large", "t2.micro"]
        },
        "ImageId": "ami-0abcdef1234567890"
      }
    }
  }
}

Refer to the exhibit. A company uses AWS CloudFormation to deploy an EC2 instance. The template uses a condition to select the instance type based on the environment. The company deploys the stack with the parameter EnvType set to 'prod'. What will be the instance type of the created EC2 instance?

⚠ Common exam trap

Many candidates confuse a false condition with skipping resource creation, but in this case the condition is used only to select a property value, not to conditionally create the resource itself.

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

t3.large

The condition in the CloudFormation template evaluates to true when EnvType equals 'prod', so the EC2 instance is created with the instance type specified in the condition's true branch, which is t3.large. The template uses a condition like 'If(Equals(EnvType, 'prod'), t3.large, t2.micro)', and since the parameter is set to 'prod', the Fn::If intrinsic function returns 't3.large'.

Answer analysis

Option-by-option breakdown

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

  • t3.large

    Why this is correct

    The condition IsProduction is true, so Fn::If returns t3.large.

  • The instance type will be determined at runtime.

    Why it's wrong here

    The template explicitly sets the instance type based on the condition.

  • The instance will not be created because the condition is false.

    Why it's wrong here

    The condition is used for instance type selection, not for resource creation.

  • t2.micro

    Why it's wrong here

    t2.micro is returned only when EnvType is not prod.

About these practice questions

One of 1,660 original SAP-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 SAP-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 SAP-C02 exam.