Courseiva

DVA-C02 AWS CloudFormation Resource Creation Practice Question

A developer is deploying a serverless application using AWS CloudFormation. The stack creation fails with the error 'The following resource(s) failed to create: [MyLambdaFunction]'. The developer checks the CloudWatch logs but finds no logs for the Lambda function. What is the most likely reason?

⚠ Common exam trap

The key trap is that candidates may assume the absence of logs means the function was never invoked or that a code error existed. However, the error explicitly states the resource failed to create, so the function was never deployed. The missing logs are a direct consequence of the creation failure, not a separate issue. The root cause is often a CloudFormation template error, such as a missing required property (e.g., 'Handler' or 'Runtime'), which causes the Lambda resource to fail creation.

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 CloudFormation template has a syntax error.

A CloudFormation template syntax error, such as a missing required property (e.g., 'Handler' or 'Runtime'), can cause the Lambda function resource to fail creation. The error message indicates the specific resource failed, and the absence of CloudWatch logs is expected because the function was never created. Option A is incorrect because code syntax errors do not prevent resource creation; they affect invocation. Option B is incorrect because the function not being invoked is a consequence, not the cause. Option C is incorrect because missing CloudWatch Logs permissions do not prevent creation; they only affect logging during invocation.

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 Lambda function code has a syntax error that prevents creation.

    Why it's wrong here

    The Lambda function code syntax error does not prevent the resource from being created; the function is deployed regardless. Syntax errors only cause invocation failures.

  • ✗

    The Lambda function was never invoked.

    Why it's wrong here

    The function was never invoked because it failed to create. This is a result, not the root cause.

  • ✗

    The Lambda function's IAM role does not have permission to write to CloudWatch Logs.

    Why it's wrong here

    Missing CloudWatch Logs permissions on the IAM role do not prevent creation of the Lambda function; they only prevent logging during invocation.

  • ✓

    The CloudFormation template has a syntax error.

    Why this is correct

    A syntax error in the CloudFormation template, such as a missing required property for the Lambda resource, can cause creation failure. The error message and lack of logs are consistent with this.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

Courseiva writes every DVA-C02 question from scratch — 1,135 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 DVA-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 DVA-C02 exam.