SOA-C02 Deployment, Provisioning, and Automation Practice Question
A SysOps administrator wants to deploy a serverless application using AWS Lambda functions, Amazon API Gateway, and Amazon DynamoDB. The deployment must be automated and repeatable. Which AWS service should the administrator use to define and manage this infrastructure as code?
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
✓
AWS CloudFormation with the AWS Serverless Application Model (SAM)
AWS CloudFormation with the AWS Serverless Application Model (SAM) is the correct choice for defining and managing serverless infrastructure as code, as SAM extends CloudFormation with shorthand syntax for Lambda, API Gateway, and DynamoDB. Option A is wrong because AWS CodeDeploy automates code deployment to running instances, not infrastructure provisioning. Option B is wrong because AWS OpsWorks manages Chef/Puppet-based application stacks. Option C is wrong because AWS Elastic Beanstalk is designed for deploying web applications on EC2, not serverless architectures.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
AWS CodeDeploy
Why it's wrong here
AWS CodeDeploy is a deployment service that automates application code releases to existing compute resources such as EC2 instances, on-premises servers, or Lambda functions, but it does not provision the underlying infrastructure. For a serverless application, you still need a way to declare and create Lambda functions, API Gateway endpoints, and IAM roles as code. CodeDeploy alone cannot orchestrate the creation of those serverless resources; it only manages the deployment lifecycle after the infrastructure exists or for Lambda traffic shifting, which requires the function to already be defined by another service like CloudFormation.
- ✗
AWS OpsWorks
Why it's wrong here
AWS OpsWorks is a configuration management service that uses Chef and Puppet to automate how software is configured and installed on managed EC2 instances or on-premises servers. It is designed for long-running, stateful compute environments and requires persistent servers, whereas serverless applications are event-driven, stateless, and have no servers to manage. OpsWorks does not provide native abstractions for Lambda functions, API Gateway, or DynamoDB tables, and forcing it to handle serverless resources would be architecturally inappropriate and operationally inefficient.
- ✗
AWS Elastic Beanstalk
Why it's wrong here
AWS Elastic Beanstalk is a PaaS service that simplifies deploying traditional web applications by automatically managing the underlying EC2 instances, load balancers, scaling, and health monitoring. It expects a continuously running application environment, not event-driven functions, so using it for a serverless application would either require you to run a web server on EC2 instances that idle or require you to create custom environments, defeating the entire purpose of serverless. Elastic Beanstalk has no built-in support for Lambda-based event processing or API Gateway integration, so it is the wrong tool for deploying a serverless application.
- ✓
AWS CloudFormation with the AWS Serverless Application Model (SAM)
Why this is correct
AWS CloudFormation with the AWS Serverless Application Model (SAM) is the definitive infrastructure-as-code approach for serverless applications. SAM is an open-source framework that extends CloudFormation with simplified syntax to define serverless resources like Lambda functions, API Gateway APIs, and DynamoDB tables in a template, then transforms them into full CloudFormation stacks. It also provides local testing via the SAM CLI, supports automatic IAM role generation, and enables deployment through CodeDeploy for safer Lambda traffic shifting, making it purpose-built for serverless. By using SAM, a SysOps administrator can version, review, and reliably replicate the entire serverless application in a repeatable, auditable way.
Visual reference
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
This SOA-C02 question is part of Courseiva's 1,169-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on SOA-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. A SysOps administrator wants to automate the creation of an AWS Lambda function and its associated IAM role using infrastructure as code. Which AWS service should be used?
easy- ✓ A.AWS CloudFormation
- B.AWS Elastic Beanstalk
- C.AWS CodeDeploy
- D.AWS Systems Manager
Why A: AWS CloudFormation is the correct service because it allows you to define both the Lambda function and its IAM role as infrastructure as code using a template (JSON or YAML). CloudFormation handles the creation, updating, and deletion of these resources in an orderly, repeatable manner, ensuring the IAM role is created before the Lambda function due to dependency management.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.