DVA-C03 · 22% of the exam
Testing and Deployment practice questions
10 free Testing and Deployment questions for the AWS Certified Developer – Associate (DVA-C03) exam, each with the correct answer and an explanation for every option.
What this domain covers
Preparing, testing and releasing applications. DVA-C03 renamed this domain Testing and Deployment: it adds container images and container deployment, and covers tests with SAM, mock APIs, test events and environments alongside CI/CD with the AWS developer tools.
- Exam weight
- 22%
- On a real exam
- ≈ 14 questions
- In our bank
- 168 questions
Topics that come up most
- SAM local testing, test events and API Gateway mock integrations
- Lambda versions, aliases and CodeDeploy traffic shifting
- ECR image tags, immutability and lifecycle policies
- ECS task definitions, Fargate and EKS manifests
- CodeBuild, CodeDeploy, CodePipeline and source branches
- Rollback with CloudFormation and CodeDeploy
How to study it
Memorise what each deployment strategy does to availability and rollback time, and the difference between the ECS task role and task execution role; the questions give a constraint and ask for the setting.
Sample Testing and Deployment questions
Try each one before opening the answer. Original questions written to the official exam objectives.
Question 1
A developer uses CodeDeploy to run an in-place deployment to an EC2 Auto Scaling group and selects the deployment configuration CodeDeployDefault.OneAtATime. What does the deployment configuration setting control for this EC2/On-Premises deployment?
- AThe minimum number or percentage of instances that must stay healthy, which determines how many instances are updated at once
- BThe order in which lifecycle event hooks such as BeforeInstall and AfterInstall run on each instance during the deployment
- CThe percentage of traffic shifted to the new version in each increment and the number of minutes to wait between increments
- DWhether CodeDeploy automatically redeploys the last known good revision when the deployment fails or an alarm threshold is met
Show answer and explanation
Answer: A) The minimum number or percentage of instances that must stay healthy, which determines how many instances are updated at once
For EC2/On-Premises deployments, a CodeDeploy deployment configuration sets minimum healthy hosts, which controls how many instances are updated at a time. OneAtATime is the default.
- AFor the EC2/On-Premises compute platform, a deployment configuration uses a minimum healthy hosts value to set how many instances must stay available during the deployment. OneAtATime deploys to one instance at a time, HalfAtATime to up to half, and AllAtOnce to as many as possible.
- BLifecycle event hooks are defined in the AppSpec file, and CodeDeploy runs them in a fixed event order. The deployment configuration does not control this order.
- CCanary and linear traffic shifting is how deployment configurations work for the Lambda and Amazon ECS compute platforms. EC2/On-Premises configurations are defined by minimum healthy hosts.
- DAutomatic rollback is set in the deployment group or deployment rollback settings, not in the deployment configuration.
Question 2
In an AWS CodePipeline execution, the Source and Build stages succeed. In the Deploy stage, one action fails because of a brief network error during an Amazon S3 upload, while the stage's other action succeeds. The stage has no automatic retry configured. The developer wants to run only the failed action again in the same execution, without repeating the earlier stages. What should the developer do?
- ARun retry-stage-execution for the Deploy stage and the current execution ID with --retry-mode FAILED_ACTIONS
- BRun start-pipeline-execution, which resumes the pipeline at the Deploy stage because the earlier stages already succeeded
- CRun retry-stage-execution for the Deploy stage with --retry-mode ALL_ACTIONS to run only the action that failed
- DDisable and then re-enable the inbound transition to the Deploy stage so the failed action runs again in the same execution
Show answer and explanation
Answer: A) Run retry-stage-execution for the Deploy stage and the current execution ID with --retry-mode FAILED_ACTIONS
CodePipeline can retry a failed stage within the same execution. The FAILED_ACTIONS mode runs only the failed actions again, and ALL_ACTIONS runs the whole stage again. Starting a new execution always begins at the Source stage.
- ACorrect. CodePipeline lets you retry a failed stage without running the pipeline again from the beginning. The FAILED_ACTIONS mode (Retry failed actions in the console) runs only the failed actions in that stage again, and the pipeline continues if they succeed.
- BIncorrect. start-pipeline-execution creates a new execution that starts from the Source stage, so Source and Build would run again. It does not resume a failed execution.
- CIncorrect. ALL_ACTIONS (Retry stage) runs every action in the stage again, starting from the first one, including the action that succeeded. Only FAILED_ACTIONS limits the retry to the failed actions.
- DIncorrect. Stage transitions control whether executions can move into a stage. Turning a transition off and on again does not retry the failed actions of an execution that already ran in that stage.
Question 3
A company manages dozens of AWS accounts with AWS Organizations. A developer must deploy a baseline security CloudFormation template to every account in a production organizational unit (OU). Accounts added to that OU later must receive the stack automatically, with no manual step. Which approach meets these requirements?
- ACreate a StackSet with service-managed permissions that targets the OU, and turn on automatic deployment
- BCreate a StackSet with self-managed permissions that targets the current account IDs in the OU
- CCreate a root stack that uses nested stacks, with one AWS::CloudFormation::Stack resource for each account
- DPackage the baseline template as a CloudFormation module in the registry and share it with the organization
Show answer and explanation
Answer: A) Create a StackSet with service-managed permissions that targets the OU, and turn on automatic deployment
Only StackSets with service-managed permissions support automatic deployment. When it is turned on, CloudFormation deploys stack instances to accounts as they join a target OU. Self-managed StackSets, nested stacks, and modules do not cover new accounts automatically.
- ACorrect. With service-managed permissions, StackSets deploy to accounts managed by AWS Organizations and create the required IAM roles for you. When automatic deployment is turned on, CloudFormation deploys a stack to any account that is added to a target OU.
- BIncorrect. With self-managed permissions, you must create the IAM roles in each target account yourself, and the StackSet deploys only to the accounts you list. Automatic deployment to new Organizations accounts is a feature of the service-managed model.
- CIncorrect. Nested stacks split one template into reusable pieces that are created as part of a parent stack. They are not a way to deploy across multiple accounts, and they do not respond to accounts being added to an OU.
- DIncorrect. Modules are reusable, versioned resource configurations that you include in your own templates. Each account would still have to deploy a stack that uses the module, so registering a module deploys nothing to new accounts.
Question 4
A SAM template defines a Lambda function's AutoPublishAlias along with a DeploymentPreference of Canary10Percent5Minutes. What does this configuration do on deployment?
- AIt shifts 10% of traffic to the new function version immediately, waits 5 minutes while monitoring for errors, then shifts the remaining 90% if no alarm triggers
- BIt immediately shifts 100% of traffic to the new version with no gradual rollout
- CIt deploys the function to 10% of AWS Regions
- DIt requires manual approval before any traffic shifts at all
Show answer and explanation
Answer: A) It shifts 10% of traffic to the new function version immediately, waits 5 minutes while monitoring for errors, then shifts the remaining 90% if no alarm triggers
- AThis is one of SAM/CodeDeploy's predefined canary deployment presets: an initial small traffic shift (10%), a defined bake time (5 minutes) to observe health via any configured CloudWatch alarms, followed by a full shift to 100% if nothing triggered a rollback.
- BThat describes an all-at-once deployment preference, not a Canary10Percent5Minutes configuration, which is specifically a gradual, monitored rollout.
- CThis setting is about traffic shifting between Lambda function versions within one deployment, not multi-Region deployment distribution.
- DA canary deployment preference like this shifts traffic automatically according to its defined percentages and timing; manual approval is a separate, optional gate (like a CodePipeline approval action), not what this specific setting does.
Question 5
A developer is writing an AppSpec file for a CodeDeploy in-place deployment to EC2 instances with no load balancer configured. The developer needs to know when each lifecycle event runs: AfterInstall, ApplicationStart, BeforeInstall, ApplicationStop, ValidateService, Install, and DownloadBundle. In which order does CodeDeploy run these events on each instance?
- ADownloadBundle → ApplicationStop → BeforeInstall → Install → AfterInstall → ApplicationStart → ValidateService
- BApplicationStop → BeforeInstall → DownloadBundle → Install → AfterInstall → ApplicationStart → ValidateService
- CApplicationStop → DownloadBundle → BeforeInstall → Install → AfterInstall → ApplicationStart → ValidateService
- DApplicationStop → DownloadBundle → BeforeInstall → Install → ApplicationStart → AfterInstall → ValidateService
Show answer and explanation
Answer: C) ApplicationStop → DownloadBundle → BeforeInstall → Install → AfterInstall → ApplicationStart → ValidateService
For an in-place deployment the order is ApplicationStop, DownloadBundle, BeforeInstall, Install, AfterInstall, ApplicationStart, ValidateService. DownloadBundle and Install are reserved for the CodeDeploy agent and can't run scripts.
- AWrong. ApplicationStop runs even before the new revision is downloaded. Its scripts come from the last successfully deployed revision, so it can't come after DownloadBundle.
- BWrong. BeforeInstall runs after DownloadBundle. The agent first copies the revision to a temporary location (DownloadBundle), then BeforeInstall runs pre-install tasks such as decrypting files or backing up the current version.
- CCorrect. This is the documented in-place order. The old application is stopped, the agent downloads the revision, BeforeInstall runs, the agent copies files to their destination (Install), AfterInstall configures the application, ApplicationStart restarts services, and ValidateService runs last. DownloadBundle and Install are reserved for the CodeDeploy agent and can't run scripts.
- DWrong. AfterInstall runs before ApplicationStart. It's meant for tasks such as configuring the application or changing file permissions before the services are started.
Question 6
A developer is configuring an AWS CodeBuild project whose buildspec.yml is stored in the application's Git repository. During the pre_build phase, the build must connect to a database using a password. Which approach follows AWS recommendations for supplying the password to the build?
- AStore the password in AWS Secrets Manager and map it to a variable under env/secrets-manager in buildspec.yml
- BDefine the password as a key/value pair under env/variables in buildspec.yml
- CAdd the password as a plaintext environment variable in the CodeBuild project settings
- DBase64-encode the password, store it under env/variables, and decode it in a build command
Show answer and explanation
Answer: A) Store the password in AWS Secrets Manager and map it to a variable under env/secrets-manager in buildspec.yml
For sensitive values, CodeBuild recommends the buildspec parameter-store or secrets-manager mappings, so only a reference is in source control and the value is resolved and masked at build time. Plaintext or merely encoded environment variables can be read by anyone with access to the repository, console or CLI.
- ACodeBuild recommends the secrets-manager (or parameter-store) mapping for sensitive values. Only the secret's name is in the buildspec. CodeBuild gets the value at build time, and Secrets Manager values are masked in build logs. The service role needs permission to read the secret.
- Benv/variables holds plaintext values. Putting the password there commits it to the Git repository, and AWS strongly discourages storing sensitive values in plaintext environment variables.
- CThis keeps the password out of Git, but plaintext environment variables can still be shown in clear text in the CodeBuild console and AWS CLI. AWS recommends Parameter Store or Secrets Manager for sensitive values.
- DBase64 is an encoding, not encryption. Anyone with repository access can decode the value. Also, a transformed value doesn't match a stored secret, so CodeBuild won't mask it in logs.
Question 7
A developer created an Amazon ECS service on AWS Fargate and accepted the defaults for the deployment controller and deployment strategy. The developer now updates the service to use a new task definition revision. Which deployment configuration does Amazon ECS use for this update?
- AThe ECS deployment controller with the rolling update strategy
- BThe CODE_DEPLOY deployment controller with a blue/green deployment
- CThe EXTERNAL deployment controller managed by a third-party tool
- DThe ECS deployment controller with the blue/green strategy
Show answer and explanation
Answer: A) The ECS deployment controller with the rolling update strategy
If the defaults are kept, an ECS service uses the ECS deployment controller with a rolling update. Tasks are replaced within the minimumHealthyPercent and maximumPercent limits. Blue/green, CodeDeploy and external controllers all have to be selected explicitly.
- ACorrect. The ECS controller with a rolling update is the default for ECS services. The service scheduler replaces running tasks with new ones, and the minimumHealthyPercent and maximumPercent settings control how many tasks are started or stopped at a time.
- BIncorrect. CodeDeploy blue/green deployments need the CODE_DEPLOY controller to be selected explicitly, along with CodeDeploy resources such as an application and deployment group. It is not the default.
- CIncorrect. The EXTERNAL controller hands deployment control to a third-party tool and has to be configured explicitly. It is not used by default.
- DIncorrect. Native ECS blue/green runs the blue and green service revisions side by side and shifts traffic between them. It must be chosen as the deployment strategy. Rolling update is the default strategy.
Question 8
A release pipeline in AWS CodePipeline has a manual approval action before the production deploy stage. Right now, an unanswered approval request stays pending for days before it fails. The team wants an unanswered request for this one action to fail after 2 hours, without changing any other pipelines in the account. What should a developer do?
- ASet timeoutInMinutes to 120 in the manual approval action's declaration in the pipeline structure
- BSet the build timeout to 120 minutes on the CodeBuild project used in the production deploy stage
- CChange the delivery policy of the approval's Amazon SNS topic so that retries stop after 120 minutes
- DSet the --cli-read-timeout option to 7200 seconds in the AWS CLI profile that approvers use
Show answer and explanation
Answer: A) Set timeoutInMinutes to 120 in the manual approval action's declaration in the pipeline structure
In CodePipeline, you can set a per-action timeout (timeoutInMinutes) only on manual approval actions, where it overrides the 7-day default. Timeouts for other action types, such as the CodeBuild build action, are fixed service values, and timeouts configured in other services don't change how long an approval waits.
- ACorrect. The ActionDeclaration timeoutInMinutes attribute overrides the default timeout (7 days at the account level) for a single action. It works only for the manual approval action type and accepts values from 5 to 86400 minutes.
- BIncorrect. A CodeBuild project timeout only limits how long that project's builds run. It has no effect on how long a separate approval action waits for a response.
- CIncorrect. The SNS delivery policy controls retries for notification delivery. It doesn't change how long CodePipeline keeps the approval action waiting before marking it failed.
- DIncorrect. That option only controls how long the local CLI waits for a socket read. It doesn't affect any timeout inside the pipeline.
Question 9
A team has built a Docker image with extra build tooling and wants an AWS CodeBuild project to run its builds in that image instead of a CodeBuild-managed image. What should the team do?
- APush the image to an Amazon ECR repository, set the image URI in the project's environment settings, and grant CodeBuild pull access to the repository
- BKeep the CodeBuild-managed image and name the custom image in the runtime-versions section of the install phase in the buildspec file
- CPublish the image to an AWS CodeArtifact repository and add that repository as an environment variable in the CodeBuild project
- DExport the image as a tarball to Amazon S3 and set that S3 object as the project's source location so CodeBuild loads it
Show answer and explanation
Answer: A) Push the image to an Amazon ECR repository, set the image URI in the project's environment settings, and grant CodeBuild pull access to the repository
CodeBuild can run builds in a custom Docker image that the project's environment configuration references, usually from Amazon ECR (or a private registry with credentials in Secrets Manager). The ECR repository policy must allow CodeBuild to pull the image when CodeBuild credentials or a cross-account image is used.
- AA CodeBuild project's environment can reference a custom image URI in Amazon ECR. If the project pulls with CodeBuild credentials, or the image is in another account, the ECR repository policy must allow the pull actions (ecr:BatchGetImage, ecr:GetDownloadUrlForLayer, ecr:BatchCheckLayerAvailability) for the codebuild.amazonaws.com service principal or the project's account.
- BThe runtime-versions section picks language runtimes that are already in the CodeBuild-managed images. It cannot replace the build environment's container image with a custom Docker image.
- CCodeArtifact stores software packages such as npm, PyPI, and Maven artifacts. It is not a container image registry that CodeBuild can pull its build environment from.
- DThe project's source location holds the code to build, not the build environment. CodeBuild does not load a container image from a source tarball. The image must come from a registry such as Amazon ECR, or from a private registry with credentials in Secrets Manager.
Question 10
A team wants a Slack message posted within seconds whenever any execution of its AWS CodePipeline pipeline ends in failure. A Lambda function that posts to Slack already exists. Which solution meets this requirement with the least operational overhead?
- ACreate an EventBridge rule whose event pattern matches source aws.codepipeline, the pipeline execution state-change detail type, and state FAILED, with the Lambda function as the target
- BCreate an EventBridge scheduled rule that invokes the Lambda function every five minutes to call GetPipelineState and post to Slack when the latest execution has failed
- CCreate an EventBridge rule that matches the CloudTrail-recorded StartPipelineExecution API call for the pipeline and invokes the Lambda function to post to Slack
- DCreate an EventBridge rule that uses the pipeline ARN as its target, and configure the Lambda function as a final action that runs only if the pipeline fails
Show answer and explanation
Answer: A) Create an EventBridge rule whose event pattern matches source aws.codepipeline, the pipeline execution state-change detail type, and state FAILED, with the Lambda function as the target
CodePipeline natively publishes pipeline, stage, and action execution state-change events to EventBridge. A rule matching source aws.codepipeline with state FAILED can invoke a Lambda target that posts to Slack, which gives near-real-time alerts without polling.
- ACodePipeline emits 'CodePipeline Pipeline Execution State Change' events to EventBridge, including a FAILED state. A rule that matches this pattern invokes the Lambda target in near real time, with no polling and no changes to the pipeline.
- BPolling on a schedule adds delay (up to the polling interval), extra code, and extra invocations. It can also miss or repeat failures between polls. The native state-change event already gives this information when the failure happens.
- CStartPipelineExecution records when an execution starts, not how it ends. A pipeline failure is not an API call made by a user, so this rule would fire on every start and never report the failure.
- DWhen a pipeline is an EventBridge target, the rule starts the pipeline; the rule does not receive events from it. Pipeline actions also run in order as stages succeed. You cannot set a final action to run only when an earlier stage fails.
Testing and Deployment: FAQs
How much of the DVA-C03 exam is Testing and Deployment?
Testing and Deployment is 22% of the DVA-C03 exam by the official exam guide's weighting, which on a 65-question form works out to roughly 14 questions. The real exam's exact split varies by form.
What does the Testing and Deployment domain cover?
Preparing, testing and releasing applications. DVA-C03 renamed this domain Testing and Deployment: it adds container images and container deployment, and covers tests with SAM, mock APIs, test events and environments alongside CI/CD with the AWS developer tools.
How should I study Testing and Deployment for DVA-C03?
Memorise what each deployment strategy does to availability and rollback time, and the difference between the ECS task role and task execution role; the questions give a constraint and ask for the setting.
Where can I practise more Testing and Deployment questions?
This page has 10 free Testing and Deployment questions with answers. CertRidge's DVA-C03 question bank has 168 questions in this domain. Every practice exam result breaks your score down by domain, and Review Mode re-drills the questions you missed.
Get Testing and Deployment exam-ready
The full DVA-C03 bank has 168 Testing and Deployment questions. Timed practice exams match the real exam's length and domain weights, every result shows your score per domain, and Review Mode re-drills the questions you missed.
Not affiliated with AWS; questions are original and never copied from the real exam.