Courseiva

DOP-C02 Configuration Management and IaC Practice Question

A DevOps engineer is troubleshooting a CloudFormation stack that fails to create an EC2 instance with a custom AMI. The error message indicates that the AMI ID does not exist. The engineer is using a mapping in the template to select the AMI based on the region. However, the stack is being created in a region not covered by the mapping. What is the most efficient way to resolve this issue?

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

✓

Retrieve the AMI ID dynamically using AWS Systems Manager Parameter Store and a dynamic reference in the template.

The most efficient way is to use AWS Systems Manager Parameter Store with a dynamic reference in the CloudFormation template. This allows the AMI ID to be resolved at deployment time based on the region, without hardcoding or maintaining mappings. Option B (creating a new mapping) is less efficient because it requires manual updates for each region. Option C (Run Command) is not designed for parameter retrieval. Option D (hardcoding) is not scalable and error-prone.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Retrieve the AMI ID dynamically using AWS Systems Manager Parameter Store and a dynamic reference in the template.

    Why this is correct

    Dynamic references resolve the AMI at deploy time from Parameter Store, so the template no longer depends on a static region mapping. This satisfies the region-agnostic constraint, letting the stack create successfully in any region without maintaining per-region map entries.

  • ✗

    Create a new mapping entry for the region by updating the template.

    Why it's wrong here

    Adding a mapping entry still requires the engineer to know and hardcode the correct AMI ID for that region, so it does not resolve the underlying lookup failure efficiently. Mappings suit static, known region-to-value pairs; a dynamic parameter or SSM public parameter query would fetch the AMI automatically.

  • ✗

    Use AWS Systems Manager Run Command to find the correct AMI ID.

    Why it's wrong here

    Run Command executes commands on existing managed instances; it cannot discover AMI IDs or feed them into a CloudFormation mapping. It is tempting because Systems Manager does expose AMI parameters, but that is Parameter Store, not Run Command, and the template must reference them directly.

  • ✗

    Hardcode the AMI ID in the template for the missing region.

    Why it's wrong here

    Hardcoding the AMI ID removes the regional lookup but breaks portability and still requires manually sourcing a valid ID, which is what caused the failure. Hardcoding is acceptable only for single-region, immutable deployments where the AMI never changes.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

Courseiva writes every DOP-C02 question from scratch — 1,298 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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 DOP-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 DOP-C02 exam.