Courseiva

SOA-C02 Deployment, Provisioning, and Automation Practice Question

A company has a CloudFormation stack that creates an Amazon EC2 instance with a user data script that installs software from the internet. The stack creation is failing with a timeout. The SysOps administrator suspects that the user data script is taking too long or failing. How can the administrator configure the stack to wait for the user data script to complete successfully before marking the instance as CREATE_COMPLETE?

⚠ Common exam trap

SOA-C02 often tests whether candidates confuse CreationPolicy (initial creation wait) with UpdatePolicy (update-time rolling behavior) — the question's 'stack creation is failing' keyword points to CreationPolicy.

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 CreationPolicy with a resource signal to the EC2 instance resource and have the user data script send a success signal using cfn-signal.

A CreationPolicy with a resource signal tells CloudFormation to wait for a success signal (via cfn-signal) from the EC2 instance before marking it CREATE_COMPLETE. The user data script calls cfn-signal after the software installation succeeds, ensuring the stack only proceeds when the instance is truly ready.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Add a CreationPolicy with a resource signal to the EC2 instance resource and have the user data script send a success signal using cfn-signal.

    Why this is correct

    A CreationPolicy on the EC2 instance resource makes CloudFormation hold the stack creation in the CREATE_IN_PROGRESS state until it receives the specified number of success signals. The user data script must invoke cfn-signal after completing its configuration steps, which directly ties the instance's readiness to the stack creation workflow. This is the only option that explicitly synchronizes CloudFormation with the completion of the user data script during initial stack creation.

  • ✗

    Add a DependsOn attribute to the EC2 instance resource to wait for another resource.

    Why it's wrong here

    The DependsOn attribute only affects the order in which CloudFormation creates resources; it does not pause creation to wait for any activity inside a resource such as user data execution. Since the EC2 instance in this scenario has no other resource that must be created before it, adding DependsOn to the instance would either have no effect or, if pointed at a resource that completes later, would merely order creation without guaranteeing the user data script has finished. Therefore, it cannot ensure that the configuration tasks in user data are complete before the stack is marked as successfully created.

  • ✗

    Add an UpdatePolicy with a resource signal to the EC2 instance resource.

    Why it's wrong here

    An UpdatePolicy with a resource signal is designed to control behavior during stack updates, such as specifying how many instances must report healthy before a rolling update continues. It has no effect during the initial creation of the stack, and CloudFormation will not wait for any signal from the user data script at creation time if only an UpdatePolicy is present. Thus, this approach fails to address the requirement to wait for user data completion when the stack is first being created.

  • ✗

    Add a WaitCondition resource and a WaitHandle, and have the user data script send a signal to the WaitHandle.

    Why it's wrong here

    A WaitCondition and WaitHandle pair can be used to make CloudFormation wait for an external signal, but it requires the user data script to call the SignalResource API or use cfn-signal with the WaitHandle URL, not the simpler cfn-signal success call used with a CreationPolicy. While this could technically work, it adds unnecessary complexity and is not the native or recommended mechanism for an EC2 instance's user data to signal readiness. The CreationPolicy with cfn-signal is the idiomatic, straightforward way to achieve the same result during stack creation.

About these practice questions

One of 1,169 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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint

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.