AWS Developer Associate (DVA-C02) · 22% practice allocation

AWS DVA-C02: Deployment Practice Questions

5 free sample questions from the Deployment domain, with answers and explanations. The full DVA-C02 bank has 275 questions across 5 domains. Questions are scenario-based and written from the official AWS exam guide.

1.

A developer is customizing an Elastic Beanstalk environment to install a third-party RPM package and create a configuration file during environment provisioning. The application source bundle is a standard ZIP file. Which mechanism should the developer use to add these customizations without modifying the platform itself?

  • A. Create YAML or JSON configuration files inside a .ebextensions directory in the application source bundle✓ Correct
  • B. Add the customizations to the Procfile in the application root
  • C. Define the package and file resource in a separate AWS CloudFormation stack and reference it from the Elastic Beanstalk environment
  • D. Upload a shell script named configure.sh to the Elastic Beanstalk S3 bucket before deploying
Explanation

The .ebextensions directory allows developers to include configuration files (with a .config extension, in YAML or JSON) inside the application source bundle. These files can install packages (using the packages key), create files (using the files key), run commands, and modify the environment without building a custom platform. — The Procfile is used to specify how to start application processes (similar to a web server command); it is not used for system-level package installation or file creation. — Uploading a shell script directly to S3 is not a recognized Elastic Beanstalk customization mechanism; Elastic Beanstalk would not automatically execute it. — Using a separate CloudFormation stack for OS-level configuration adds unnecessary complexity and tight coupling; .ebextensions handles this natively within the deployment bundle.

2.

A company is containerizing a microservice and storing images in Amazon ECR. To control storage costs, the team wants to automatically delete untagged images older than 30 days and retain only the 10 most recent images tagged with 'release-*'. Which ECR feature should the team configure to achieve this?

  • A. An S3 lifecycle policy on the ECR-managed S3 bucket
  • B. An Amazon EventBridge rule that triggers a Lambda function to delete old images on a schedule
  • C. An ECR image scanning policy to flag and remove vulnerable images
  • D. An ECR lifecycle policy with rules targeting untagged images and tag-prefixed images✓ Correct
Explanation

ECR lifecycle policies allow you to define rules that automatically expire images based on age (sinceImagePushed), count (imageCountMoreThan), and tag status (tagged, untagged, or a tag prefix pattern). You can create one rule for untagged images older than 30 days and another to keep only the 10 most recent 'release-*' tagged images. — ECR image scanning identifies OS and software vulnerabilities in images; it does not delete or expire images based on age or count. — ECR does not expose its underlying storage as a user-accessible S3 bucket; S3 lifecycle policies cannot be applied to ECR images directly. — An EventBridge-triggered Lambda could accomplish this but requires custom code, ongoing maintenance, and permissions management that ECR lifecycle policies handle natively without additional infrastructure.

3.

A developer is writing a buildspec.yml for a Node.js application. The build process requires an API key that must not appear in plain text in the repository. The key is already stored as a SecureString in AWS Systems Manager Parameter Store under the path /myapp/prod/api-key. How should the developer reference this value in the buildspec.yml?

  • A. Export the variable in the install phase using an echo command that calls the SSM API with the AWS CLI
  • B. Define the variable under the env/variables section and hard-code the value in the CodeBuild project settings
  • C. Define the variable under the env/secrets-manager section and reference the SSM parameter ARN
  • D. Define the variable under the env/parameter-store section and reference the parameter path as the value✓ Correct
Explanation

The env/parameter-store section in buildspec.yml is specifically designed to retrieve values from AWS Systems Manager Parameter Store at build time. CodeBuild fetches and injects the value as an environment variable without it ever being stored in the source code. — The env/variables section stores plaintext values, which defeats the purpose of securing the secret. — The env/secrets-manager section is for AWS Secrets Manager, not SSM Parameter Store; using the SSM parameter ARN here would fail or retrieve the wrong resource. — Manually calling the SSM API in the install phase would work technically but is error-prone, harder to maintain, and does not leverage CodeBuild's native secret injection support.

4.

A developer is configuring an AWS CodeBuild project to compile a Java application and upload the resulting JAR file to an S3 bucket. The developer needs to define the build commands and specify the output artifact. Which file should the developer create at the root of the source repository to configure this behavior?

  • A. template.yaml
  • B. appspec.yml
  • C. buildspec.yml✓ Correct
  • D. Dockerfile
Explanation

buildspec.yml is the build specification file that CodeBuild looks for at the root of the source repository by default. It defines phases (install, pre_build, build, post_build), environment variables, and artifact output paths. — appspec.yml is used by CodeDeploy to manage deployment lifecycle hooks, not CodeBuild. — template.yaml is used by AWS SAM or CloudFormation to define infrastructure, not build commands. — Dockerfile defines container image build steps for Docker, not a CodeBuild build specification.

5.

A developer has deployed a new version of an AWS Lambda function and wants to gradually shift traffic from the stable version to the new version. The plan is to route 10% of traffic to the new version initially, then automatically increment traffic by 10% every 10 minutes until 100% of traffic reaches the new version. The developer wants automatic rollback if the error rate increases. Which combination of Lambda features and CodeDeploy deployment configuration achieves this? (Select TWO)

  • A. Configure CodeDeploy with the CodeDeployDefault.LambdaCanary10Percent10Minutes deployment configuration
  • B. Set a Lambda concurrency reservation of 10% on the new version to limit its traffic share
  • C. Enable Lambda function versioning and update the $LATEST version with the new code directly
  • D. Configure CodeDeploy with the CodeDeployDefault.LambdaLinear10PercentEvery10Minutes deployment configuration✓ Correct
  • E. Create a Lambda alias that points to both the stable and new function versions with weighted routing✓ Correct
  • F. Define a CloudWatch alarm monitoring the Lambda error rate and attach it to the CodeDeploy deployment group for automatic rollback
Explanation

A Lambda alias supports weighted routing between two function versions, which is the mechanism CodeDeploy uses to shift traffic. CodeDeploy updates the alias weights automatically during deployment. The CodeDeployDefault.LambdaLinear10PercentEvery10Minutes configuration shifts traffic linearly, adding 10% every 10 minutes until all traffic is on the new version — matching the described requirement exactly. Together, these two form the correct answer. — Updating $LATEST directly does not create a separate version for traffic splitting; traffic shifting requires distinct published versions. — The Canary configuration shifts a fixed initial percentage and then shifts the remainder all at once (e.g., 10% then 90%), not incrementally every 10 minutes — this matches a canary deployment, not the linear one described. — A CloudWatch alarm attached to the deployment group is important for automatic rollback, but the question asks for the combination that achieves the gradual traffic shift; the alarm alone does not implement the shifting. — Lambda concurrency reservations throttle the total invocations of a version but do not implement percentage-based traffic routing.

Test yourself across every DVA-C02 domain

The free DVA-C02 practice test mixes about 20 questions weighted like the exam. The full 275-question bank adds instant grading, flashcards and a timed mock exam.

Study this domain

Deployment study guide (DVA-C02) →

Other DVA-C02 domains

← All AWS Developer Associate study resources