Amazon DVA-C02 Practice Exams
Last updated on Oct 21,2026- Exam Code: DVA-C02
- Exam Name: AWS Certified Developer - Associate
- Certification Provider: Amazon
- Latest update: Oct 21,2026
A developer is creating AWS CloudFormation templates to manage an application’s deployment in Amazon Elastic Container Service (Amazon ECS) through AWS CodeDeploy. The developer wants to automatically deploy new versions of the application to a percentage of users before the new version becomes available for all users.
How should the developer manage the deployment of the new version?
- A . Modify the CloudFormation template to include a Transform section and the AWS::CodeDeploy::BlueGreen hook.
- B . Deploy the new version in a new CloudFormation stack. After testing is complete, update the application’s DNS records for the new stack.
- C . Run CloudFormation stack updates on the application stack to deploy new application versions when they are available.
- D . Create a nested stack for the new version. Include a Transform section and the AWS::CodeDeploy::BlueGreen hook.
A developer is building an application that uses an AWS Lambda function to process data. The application requires minimum latency. The Lambda function must have predictable function start times. All setup activities for the execution environment must happen before invocation of the Lambda function.
Which solution will meet these requirements?
- A . Increase the memory of the Lambda function to the maximum amount. Configure an Amazon EventBridge rule to schedule invocations of the Lambda function every minute to keep the execution environment active.
- B . Optimize the static initialization code that runs when a new execution environment is prepared for the first time. Decrease and compress the size of the Lambda function package and the imported libraries and dependencies.
- C . Increase the reserved concurrency of the Lambda function to the maximum value for unreserved account concurrency. Run any setup activities manually before the initial invocation of the Lambda function.
- D . Publish a new version of the Lambda function. Configure provisioned concurrency for the Lambda function with the required minimum number of execution environments.
A company is using the AWS Serverless Application Model (AWS SAM) to develop a social media application. A developer needs a quick way to test AWS Lambda functions locally by using test event payloads. The developer needs the structure of these test event payloads to match the actual events that AWS services create.
- A . Create shareable test Lambda events. Use these test Lambda events for local testing.
- B . Store manually created test event payloads locally. Use the sam local invoke command with the file path to the payloads.
- C . Store manually created test event payloads in an Amazon S3 bucket. Use the sam local invoke command with the S3 path to the payloads.
- D . Use the sam local generate-event command to create test payloads for local testing.
D
Explanation:
Comprehensive Detailed Step by Step Explanation with All AWS Developer
Reference: The AWS Serverless Application Model (SAM) includes features for local testing and debugging of AWS Lambda functions. One of the most efficient ways to generate test payloads that match actual AWS event structures is by using the sam local generate-event command.
sam local generate-event: This command allows developers to create pre-configured test event payloads for various AWS services (e.g., S3, API Gateway, SNS). These generated events accurately reflect the format that the service would use in a live environment, reducing the manual work required to create these events from scratch.
Operational Overhead: This approach reduces overhead since the developer does not need to
manually create or maintain test events. It ensures that the structure is correct and up-to-date with
the latest AWS standards.
Alternatives:
Option A suggests using shareable test events, but manually creating or sharing these events introduces more overhead.
Option B and C both involve manually storing and maintaining test events, which adds unnecessary complexity compared to using sam local generate-event.
Reference: AWS SAM CLI documentation
A healthcare company is developing a multi-tier web application to manage patient records that are in an Amazon Aurora PostgreSQL database cluster. The company stores the application code in a Git repository and deploys the code to Amazon EC2 instances.
The application must comply with security policies and follow the principle of least privilege. The company must securely manage database credentials and API keys within the application code. The company must have the ability to rotate encryption keys on demand.
Which solution will meet these requirements?
- A . Store database credentials and API keys in AWS Secrets Manager. Use AWS managed AWS KMS keys. Set up automatic key rotation. Use the AWS SDK to retrieve secrets.
- B . Store the database credentials and API keys in AWS Secrets Manager. Use customer managed AWS KMS keys. Set up automatic key rotation. Create a key policy in the application to retrieve secrets by using the AWS SDK.
- C . Store the database credentials in the application code. Separate credentials by using environment-specific branches that have restricted access to the code repositories.
- D . Store the database credentials and API keys as parameters in AWS Systems Manager Parameter Store. Encrypt the credentials and API keys with AWS managed AWS KMS keys. Use the AWS SDK to retrieve secrets.
A
Explanation:
Requirement Summary:
Multi-tier app on EC2 + Aurora PostgreSQL
Must comply with least privilege and security policies
Need to manage credentials and API keys securely
Must support key rotation on demand
Evaluate Options:
✅ A. Secrets Manager + AWS managed KMS keys
✅ Best practice for secure secret storage
✅ Supports auto rotation
✅ Uses AWS SDK to fetch at runtime (secure, avoids hardcoding) AWS managed keys are rotated automatically and easier to manage B. Secrets Manager + customer managed keys
⚠️ Also valid, but adds complexity
Since the question asks for LEAST development effort, AWS-managed keys are preferred C. Store secrets in code
❌ Violates all security best practices
D. Use SSM Parameter Store + AWS managed keys
⚠️ Possible, but Secrets Manager is preferred when rotation is needed Parameter Store does not natively rotate secrets
Secrets Manager: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html
Automatic key rotation: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
Best practices for secret management:
https://docs.aws.amazon.com/secretsmanager/latest/userguide/best-practices.html
A developer is building a highly secure healthcare application using serverless components. This application requires writing temporary data to /Imp storage on an AWS Lambda function.
How should the developer encrypt this data?
- A . Enable Amazon EBS volume encryption with an AWS KMS key in the Lambda function configuration so that all storage attached to the Lambda function is encrypted.
- B . Set up the Lambda function with a role and key policy to access an AWS KMS key. Use the key to generate a data key used to encrypt all data prior to writing to Amp storage.
- C . Use OpenSSL to generate a symmetric encryption key on Lambda startup. Use this key to encrypt the data prior to writing to /tmp.
- D . Use an on-premises hardware security module (HSM) to generate keys, where the Lambda function requests a data key from the HSM and uses that to encrypt data on all requests to the function.
A developer created an AWS Lambda function that accesses resources in a VPC. The Lambda function polls an Amazon Simple Queue Service (Amazon SOS) queue for new messages through a VPC endpoint. Then the function calculates a rolling average of the numeric values that are contained in the messages. After initial tests of the Lambda function, the developer found that the value of the rolling average that the function returned was not accurate.
How can the developer ensure that the function calculates an accurate rolling average?
- A . Set the function’s reserved concurrency to 1. Calculate the rolling average in the function. Store the calculated rolling average in Amazon ElastiCache.
- B . Modify the function to store the values in Amazon ElastiCache. When the function initializes, use the previous values from the cache to calculate the rolling average.
- C . Set the function’s provisioned concurrency to 1. Calculate the rolling average in the function. Store the calculated rolling average in Amazon ElastiCache.
- D . Modify the function to store the values in the function’s layers. When the function initializes, use the previously stored values to calculate the rolling average.
A developer maintains a serverless application that uses an Amazon API Gateway REST API to invoke an AWS Lambda function by using a non-proxy integration. The Lambda function returns data, which is stored in Amazon DynamoDB.
Several application users begin to receive intermittent errors from the API. The developer examines Amazon CloudWatch Logs for the Lambda function and discovers several ProvisionedThroughputExceededException errors.
The developer needs to resolve the errors and ensure that the errors do not reoccur.
- A . Use provisioned capacity mode for the DynamoDB table, and assign sufficient capacity units.
Configure the Lambda function to retry requests with exponential backoff. - B . Update the REST API to send requests on an Amazon SQS queue. Configure the Lambda function to process requests from the queue.
- C . Configure a usage plan for the REST API.
- D . Update the REST API to invoke the Lambda function asynchronously.
A
Explanation:
Comprehensive and Detailed Step-by-Step
Option A: Provisioned Capacity with Exponential Backoff:
Using provisioned capacity ensures sufficient throughput for the DynamoDB table.
Configuring the Lambda function to implement exponential backoff retries reduces the chance of exceeding capacity during peak usage.
This combination addresses the root cause (ProvisionedThroughputExceededException) and prevents
errors without overprovisioning.
Why Other Options Are Incorrect:
Option B: Using SQS adds unnecessary latency and complexity. The issue lies in DynamoDB throughput, not request management.
Option C: A usage plan for the API does not address throughput issues in DynamoDB.
Option D: Invoking the Lambda function asynchronously does not resolve the DynamoDB capacity
issue and might lead to delayed processing.
Reference: DynamoDB Provisioned Throughput Documentation
A developer is writing a serverless application that requires an AWS Lambda function to be invoked every 10 minutes.
What is an automated and serverless way to invoke the function?
- A . Deploy an Amazon EC2 instance based on Linux, and edit its /etc/confab file by adding a command to periodically invoke the lambda function
- B . Configure an environment variable named PERIOD for the Lambda function. Set the value to 600.
- C . Create an Amazon EventBridge rule that runs on a regular schedule to invoke the Lambda function.
- D . Create an Amazon Simple Notification Service (Amazon SNS) topic that has a subscription to the Lambda function with a 600-second timer.
C
Explanation:
The solution that will meet the requirements is to create an Amazon EventBridge rule that runs on a regular schedule to invoke the Lambda function. This way, the developer can use an automated and serverless way to invoke the function every 10 minutes. The developer can also use a cron expression or a rate expression to specify the schedule for the rule. The other options either involve using an Amazon EC2 instance, which is not serverless, or using environment variables or query parameters, which do not trigger the function.
Reference: Schedule AWS Lambda functions using EventBridge
A developer previously deployed an AWS Lambda function as a .zip package. The developer needs to deploy the Lambda function as a container.
- A . Create an Amazon ECR repository in the same AWS Region as the Lambda function. Package the Lambda function into a container image. Build the image and upload it to the Amazon ECR repository. Update the existing Lambda function configuration to specify the repository URI and container image tag.
- B . Create an AWS SAM template that defines the Lambda function and its resources as code. Include a container image in the template, and store the container image in an Amazon S3 bucket. Deploy the AWS SAM template. Specify the S3 bucket URI.
- C . Create an AWS CloudFormation template that defines the Lambda function and its resources as code. Include a container image in the template, and store the image in an Amazon S3 bucket. Deploy the CloudFormation template. Specify the S3 bucket URI.
- D . Create an Amazon ECR repository in the same AWS Region as the Lambda function. Build the image and upload it to the Amazon ECR repository. Update the existing Lambda function to use the new image by specifying the repository URI.
A
Explanation:
Why Option A is Correct:
Converting a Lambda function to use a container image involves packaging the function code into a container image, storing the image in Amazon Elastic Container Registry (ECR), and updating the function to use the ECR repository URI.
Why Other Options are Incorrect:
Option B: SAM templates support container-based Lambda deployment, but storing the image in S3 is not applicable.
Option C: CloudFormation does not natively support specifying Lambda container images in S3.
Option D: While partially correct, it omits the need to specify the image tag for the deployment.
AWS Documentation
Reference: Lambda Container Images
A developer is migrating a containerized application from an on-premises environment to an Amazon ECS cluster.
In the on-premises environment, the container uses a Docker file to store the application. Service dependency configurations such as databases, caches, and storage volumes are stored in a docker-compose.yml file.
Both files are located at the top level of the code base that the developer needs to containerize. When the developer deploys the code to Amazon ECS, the instructions from the Docker file are carried out. However, none of the configurations from docker-compose.yml are applied. The developer needs to resolve the error and ensure the configurations are applied.
- A . Store the file path for the docker-compose.yml file as a Docker label. Add the label to the ECS cluster’s container details.
- B . Add the details from the docker-compose.yml file to an ECS task definition. Associate the task with the ECS cluster.
- C . Create a namespace in the ECS cluster. Associate the docker-compose.yml file to the namespace.
- D . Update the service type of the ECS cluster to REPLICA, and redeploy the stack.
B
Explanation:
Why Option B is Correct:
Amazon ECS does not natively process docker-compose.yml files. Instead, the configurations from docker-compose.yml must be converted into ECS-compatible configurations within a task definition. Task definitions are the primary way to specify container configurations in ECS, including service dependencies like databases, caches, and volumes.
Steps to Resolve the Error:
Extract the configurations from the docker-compose.yml file.
Map the dependencies and settings to the appropriate ECS task definition fields.
Deploy the task definition to the ECS cluster.
Why Other Options are Incorrect:
Option A: Docker labels do not directly impact ECS task execution or integrate with ECS service configurations.
Option C: ECS namespaces do not exist as a feature.
Option D: Changing the service type to REPLICA does not resolve the issue of missing service
dependency configurations.
AWS Documentation
Reference: Amazon ECS Task Definitions
Migrating Docker Compose Workloads to ECS